Hello,
Currently developing an application using the newest version of symfony, obtained through PEAR. This is my exact schema configuration
propel:
user:
id:
name: { type: varchar(255), required: true }
level: { type: integer, required: true, default: 1 }
created_at:
post:
id:
title: { type: varchar(255)...
The global layout.php file contains the tags for each page:
<body>
<?php echo $sf_content ?>
</body>
But for all my inner HTML pages of the site, a class is applied to the body tag:
<body class="inner-page">
<?php echo $sf_content ?>
</body>
How can I pass in a class to the layout from different templates?
...
In my Symfony application, I want to set zip file as one of the mime type during the file upload, the code to do this is below:
$this->validatorSchema ['Documents'] = new sfValidatorFile (
array ('mime_types' => array(
'application/zip',
'image/jpeg',
'image/pjpeg',
'image/png',
'image/x-png',
'image/...
Hi!
I'm using symfony 1.2 with sfguard 1.4.1.
what's the best practice to register a new user to the system?
10x
...
In Symfony 1.2, how do you create variables in actions.class.php so that they are accessible in layout.php?
...
I want to know the difference between :
$this->forward("module", "action");
And
$this->redirect("module/action");
My first guess is that one implies a new request while the other one not, but I'm not sure.
...
Let's say that I have YAML scheme looking like that :
Note:
options:
type: MyISAM
collate: utf8_unicode_ci
charset: utf8
actAs: { Timestampable: ~ }
columns:
content: { type: string, notnull: true}
order_id: int(5)
user_id : int
relations:
User:
foreignAlias: Notes
local: user_id
for...
In an action, I set some feedback for the user :
$this->getUser()->setFlash('message', array(
"type" => "notice",
"content" => "Well done buddy, you did it."
));
$this->redirect('home/index');
In the view, I just use the following code :
<?php if ($sf_user->hasFlash('message')): $message = $sf_user->getFlash('mes...
I found this:
http://www.symfony-zone.com/wordpress/2008/12/13/use-routing-to-server-localized-and-dynamic-javascript/
But I saw that it has already been built into Symfony with the use_dynamic_javascript() AssetHelper.
I can't find any documentation for using this helper though. Any examples, links, or anything to help? Thanks.
...
When creating an sfPropelRouteCollection, how can I edit the action names that the collection will generate?
For example:
# Routing for "product" CRUD
product:
class: sfPropelRouteCollection
options:
model: Product
module: product
actions: [new, create, edit, update, delete]
...
I cannot figure out how to write the following query using the DbFinderPlugin 1.2.2 with Symfony and Propel:
SELECT species, COUNT(*) FROM Bird GROUP BY species;
Here is the DbFinderPlugin page
I am rather new to the plugin, and I do love it so far, but this query has so far stumped me.
...
I'd like to set a variable in my Symfony action that holds the rendered template data for that action. I'm returning some JSON content with the action, and I'd like to store what the action would be outputting into the JSON and return it.
public function executeAjaxPriceAdditionCreate(sfWebRequest $request)
{
$this->form = new ProductP...
I have very simple company index with Zend Lucene using this to create the index:
// store company primary key to identify it in the search results
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', $this->getId()));
// index company fields
$doc->addField(Zend_Search_Lucene_Field::Unstored('zipcode', $this->getZipcode(), 'utf-8'));...
How can I write the following SQL query using the Propel ORM?
SELECT species, COUNT(*) FROM Bird GROUP BY species;
...
I have the following model :
class Model extends BaseModel
{
public function save($conn = null)
{
if(!$this->getId())
{
//do stuff
}
return parent::save($conn);
}
}
I feel like I am follwing the API description of Doctrine_Record::save() signature (Except the weird parenthesis I would give me...
Is there an Elmah equivalent for PHP in general, Symfony in particular?
...
I am building a URL inside of a class and I'd like to be able to change the routing if necessary later by just changing the routing.yml file.
If I have the route:
userSignup:
url: /user/signup
param: { module: user, action: signup }
How can I use the url_for('userSignup') helper in a class to dynamically create the URL?
...
I'm about to begin building a huge clinical healthcare application with PHP, and I'm looking for some advice on a framework. I need to be able to come up with a quick prototype, so it's important that the framework takes care of many mundane tasks; therefore, I've narrowed it down to CakePHP or Symfony.
I'm hoping to get a few developer...
There are no examples of use anywhere, or even an explanation on how to use it.
...
I have a form created with Symfony forms.
and in the template i have this selectbox, displayed on the page with the render method.
<?php echo $form['field']->render() ?>
is it possible to set the selected option of this select box?
Or does this have to be done in the class that creates this form?
There is the creation of the field...