symfony

Problems with database relations with symfony framework - Cannot fetch TableMap for undefined table

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)...

How can you pass a parameter from an action to the layout in Symfony

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? ...

Set mime_types not working for zip file in Symfony

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/...

how to add users to sfguard

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 ...

How do you create variables in actions.class.php so that they are accessible in layout.php?

In Symfony 1.2, how do you create variables in actions.class.php so that they are accessible in layout.php? ...

What is the difference between redirect and forward in Symfony ?

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. ...

Why am I getting "validator failed" one a save with Doctrine on Symfony 1.2 ?

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...

Am I using the Symfony flash variables the wrong way ?

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...

How to use PHP inside JS files (with Symfony)?

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. ...

Modify action names for route collections in Symfony?

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] ...

How do I formulate a query using the Symfony Plugin DbFinderPlugin to count grouped by columns?

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. ...

In Symfony, how to retrieve the rendered template content as a variable in an action?

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...

How do you search zipcodes using Zend Lucene?

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 a SQL count with group by clause using Propel ORM in Symfony?

How can I write the following SQL query using the Propel ORM? SELECT species, COUNT(*) FROM Bird GROUP BY species; ...

Why overriding Doctrine_Record::save() give me a strict standard error in Symfony 1.2 ?

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...

Elmah For other PHP

Is there an Elmah equivalent for PHP in general, Symfony in particular? ...

In Symfony, how can I use the url_for helper in a class?

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? ...

PHP MVC Framework for the enterprise.

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...

How to use symfony's use_dynamic_javascript() helper?

There are no examples of use anywhere, or even an explanation on how to use it. ...

how to set the selected option in Symfony forms select box

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...