views:

15

answers:

1

Hello,

In my form I want to use a widget Doctrine, but I can't change the method use to display the result of the doctrine query.

I have make a function in my model :

public function quartiers() {
  return $this->getQuartier();
}

And in MyClassForm :

$this->widgetSchema['list_quartiers'] = new sfWidgetFormDoctrineChoice(array('model'=>Parclogement',
'add_empty'=>false, 'method' => 'quartiers()', 'query'=> $result = Doctrine_Query::create()->select('p.quartier'->from('Parclogement p'->groupBy('quartier')));

I have this error :

Unknown method Parclogement::quartiers()

When I try my widget with the default method (__toString), It works.

+1  A: 

Maybe it's the parentheses after 'quartiers()'? Try making it 'method' => 'quartiers'?

mganjoo
Thanks, it works
Corum