A symfony tip: "Your name here"

Fabien Potencier

November 08, 2007

When creating a module with the init-module task (generate:module in symfony 1.1), symfony creates an actions.class.php file:

[?php

/**
 * article actions.
 *
 * @package    symfony
 * @subpackage article
 * @author     Your name here
 * @version    SVN: $Id$
 */
class articleActions extends sfActions
{
  /**
   * Executes index action
   *
   */
  public function executeIndex()
  {
    $this->forward('default', 'module');
  }
}

symfony generates the class content and adds some PHPDoc comments. But if you have a closer look, you see that the author is a meaningless Your name here placeholder.

You can change this default by adding an author property in the config/properties.ini file:

[symfony]
  name=aidedecamp
  author=Fabien Potencier 

symfony will now use this author when generating a module:

[?php

/**
 * article actions.
 *
 * @package    symfony
 * @subpackage article
 * @author     Fabien Potencier 
 * @version    SVN: $Id$
 */
class articleActions extends sfActions
{
  /**
   * Executes index action
   *
   */
  public function executeIndex()
  {
    $this->forward('default', 'module');
  }
}

The name property is used for the following tasks in symfony 1.0:

  • init-module
  • init-controller
  • init-batch
  • propel-generate-crud
  • propel-init-crud
  • propel-init-admin

Here is the tasks list for symfony 1.1:

  • generate:module
  • generate:controller
  • generate:batch
  • propel:generate-crud
  • propel:generate-admin