【问题标题】:get values of all selected checkboxes symfony2获取所有选定复选框symfony2的值
【发布时间】:2016-02-24 17:11:05
【问题描述】:
<th scope="col">{{ d.id }} <input type="checkbox" value="{{ d.id }}" name="checkboxD" class="checker"></th>

如何从选中的复选框中获取值列表??

我的控制器操作

        public function traiterAction() {
            $IDs = array();
            if ( $this->getRequest()->isMethod('POST') ) {

            $IDs = $this->getRequest()->get('checkboxD');
            }
            return $this->render('@EgovPoste/test.html.twig',array('ids'=>$IDs));
    }

【问题讨论】:

    标签: symfony symfony-2.6


    【解决方案1】:

    您需要将名称更改为 checkboxD[] 。 希望对你有帮助

    【讨论】:

      猜你喜欢
      • 2015-06-28
      • 1970-01-01
      • 2017-04-03
      • 1970-01-01
      • 2011-08-17
      • 2021-03-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多