Thanks. This works.

But it doesn't seem very clean to have to define the __() and getI18N
() methods in the Form. Is there a better place to define these static
choice strings? To me it appears that they are part of the model.

Regards,

René

Cédric Sadai wrote:
> $w['stuff'] = new sfWidgetFormSelect( array('choices' => array('draft'
> => $this->__('draft'), 'published' => $this->__('published'))) );
>
> protected function __($string, $args = array(), $catalogue =
> 'messages')
> {
>     return $this->getI18N()->__($string, $args, $catalogue);
> }
>
> protected function getI18N()
> {
>     return sfContext::getInstance()->getI18N();
> }
>
> If you really want to define your static choices in your model, I
> would consider smthg like
>
> $choices = DemoArticlePeer::getStatusChoices();
> $i18nChoices = array_map(array($this, '__'), $choices);
>
> hope this helps,
>
> Cheers,
>
> Cedric
> http://sadai.net
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to