Symfony World blog is not maintained anymore. Check new sys.exit() programming blog.

where is include_custom in symfony 1.2-1.4 form?

The include_custom feature was available in version 1.0 and has disappeared from symfony forms since newer versions. Take a look at the doctrine form api - add_empty options shall be used. There are two possible ways to define new include_custom. The first one is to include a blank option:

$this->widgetSchema['market_id'] =  new sfWidgetFormDoctrineChoice(array(
  'model' => $this->getRelatedModelName('Market'),
  'add_empty' => true

The second way is to include an option with a defined label:

$this->widgetSchema['market_id'] = new sfWidgetFormDoctrineChoice(array(
  'model' => $this->getRelatedModelName('Market'),
  'add_empty' => 'whichever you want'

And that's it.

No comments:

Post a Comment