2 different ways to define a widget in symfony, which to use?

Posted by fayer on Stack Overflow See other posts from Stack Overflow or by fayer
Published on 2010-06-01T14:49:12Z Indexed on 2010/06/01 14:53 UTC
Read the original article Hit count: 155

Filed under:

in the tutorial i can use either:

public function configure() {
    $this->setWidgets(array(
    'type' => new sfWidgetFormChoice(array(
                'choices' => Doctrine_Core::getTable('Gender')->getTypesForForm(),
                'expanded' => false,
                'multiple' => false,
    ))
));


    $this->widgetSchema['type'] = new sfWidgetFormChoice(array(
                'choices' => Doctrine_Core::getTable('Gender')->getTypesForForm(),
                'expanded' => false,
                'multiple' => false,
            ));
}

to define a widget.

i wonder which i should use and why there is 2 ways of writing this?

thanks

© Stack Overflow or respective owner

Related posts about symfony