You have to pass a Doctrine query to the widget, not a Doctrine collection.
(Note the "Query" part in my getCampaignsQuery() table method example.)
Samuel Morhaim wrote:
Syam.. that didnt work it gives me an error.
$query =
Doctrine::getTable('Campaign')->getCampaigns(sfContext::getInstan
Syam.. that didnt work it gives me an error.
$query =
Doctrine::getTable('Campaign')->getCampaigns(sfContext::getInstance()->getUser()->getGuardUser()->Organization);
$this->widgetSchema['campaign_id'] = new
sfWidgetFormDoctrineChoice(array
(
'model' => 'Campaign',
Hi,
You can use the sfWidgetFormDoctrineChoice widget with the 'query'
option, thus, you can pass params to your query throught the form option
system :
*In action :*
$this->form = new campaignForm($record, array('organization' =>
$user->organization) // or any param you want from $request o
I have a question, I have a dropdown that needs to be populated from the
database, but with a query, and the query is based on a post variable.
I know that sfWidgetFormDoctrineChoice has an option for passing a method,
but I can't pass a method + parameter like that.
So I used the simple sfWidget