【问题标题】:cakephp label in checkbox复选框中的cakephp标签
【发布时间】:2011-08-17 14:10:49
【问题描述】:

我正在尝试使用带有他的标签的复选框

echo $this->Form->checkbox('straordinari', array('div'=>'true', 'label' => 'Straordinari'));

在浏览器中我得到

<input id="ReportStraordinari_" type="hidden" value="0" name="data[Report][straordinari]">
<input id="ReportStraordinari" type="checkbox" value="1" label="Straordinari" div="true" name="data[Report][straordinari]">

但是没有标签

问题出在哪里?

【问题讨论】:

    标签: checkbox label cakephp-1.3 formhelper


    【解决方案1】:

    您应该通过以下方式获得所需的内容:

    echo $this->Form->input('straordinari', array('type' => 'checkbox'));
    

    【讨论】:

      【解决方案2】:

      我使用:

      <?php 
      echo $this->Form->input('coupDeCoeur', 
      array('div' => false,
      'label' => false,
      'type' => 'checkbox',
      'before' => '<label class="checkbox">',
      'after' => '<i></i>coupDeCoeur</label>'
      ));
      ?>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-06
        • 1970-01-01
        • 1970-01-01
        • 2016-08-23
        相关资源
        最近更新 更多