Skip to content

Instantly share code, notes, and snippets.

@ubermuda
Created October 30, 2008 15:21
Show Gist options
  • Save ubermuda/21048 to your computer and use it in GitHub Desktop.
Save ubermuda/21048 to your computer and use it in GitHub Desktop.
<?php
class zdComparatorForm extends sfForm
{
public function setup()
{
$this->setWidgets(array(
'product_line' => new sfWidgetFormPropelChoice(array('add_empty' => true, 'model' => 'zdProductLine')),
'model' => new sfWidgetFormChoice(array('choices' => new sfCallable(array($this, 'getModelChoices')))),
));
$this->setValidators(array(
'product_line' => new sfValidatorPropelChoice(array('model' => 'zdProductLine')),
'model' => new sfValidatorCallback(array('callback' => array($this, 'validateModel'))),
));
$this->widgetSchema->setNameFormat('zd_comparator[%s]');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment