Monday, November 1, 2010

Symfony 1.4 Making Proper Use Of MVC

Use of the Peer class in lib/model/


You can use this if you  need to get any datasets from the database
public static function ....

Use class in lib/model/


Put code here when you need to call functions from an object, even if that is linking to another object.

Use of Criteria


When using SQL statements, don't worry about converting dates and strings to work in SQL, Propel does it for you.

Clear cache


Clear cache when you think you need it, it does not matter when you are developing. Better to clear cache and get the latest changes than not.

Symfony link_to going to new window

From Symfony 1.x reference


<?php echo link_to('my article', 'article/read?title=Finance_in_France', array(
  'class'  => 'foobar',
  'target' => '_blank'
)) ?>