[Symfony] - 从所选项目中获取价值

时间:2011-05-05 13:24:29

标签: select jquery symfony1 widget

如何从选择选项中获取所选项目的值在symfony?(来自以下文章)

我的表单中包含该配置:

$this->widgetSchema['category_id'] = new sfWidgetFormDoctrineChoice(array(
        'model'     => 'Category',
        'method'    => 'getLibelleCat',
        'add_empty' => 'select category'
 ));

$this->widgetSchema['article_id'] = new sfWidgetFormDoctrineDependentSelect (array(
        'model'     => 'Article',
        'method'    => 'getLibelle',
        'depends'   => 'Category',
        'add_empty' => 'select article'

));

由于

1 个答案:

答案 0 :(得分:1)

嗯......我不确定理解这个问题,但我建议:

$this->getValue('category_id');