【问题标题】:[Symfony]--Get value from selected Item[Symfony]--从选中的项目中获取价值
【发布时间】:2011-05-05 13:24:29
【问题描述】:

如何从 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'

));

谢谢

【问题讨论】:

    标签: select jquery symfony1 widget


    【解决方案1】:

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

    $this->getValue('category_id');
    

    【讨论】:

    • 不,不是。从第二个列表 widgetSchema['article_id'] 中选择选项后,我正在搜索显示表的详细信息 --article--... 我该怎么做?
    猜你喜欢
    • 2017-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-10
    • 2018-03-08
    • 2018-02-03
    • 1970-01-01
    • 2019-03-23
    相关资源
    最近更新 更多