如何在CakePHP 3.x中显示复选框?或模板以在CakePHP 3.x中显示复选框

如何在CakePHP 3.x中显示复选框?或模板以在CakePHP 3.x中显示复选框,cakephp,cakephp-3.0,Cakephp,Cakephp 3.0,我有代码要显示:- <div class="row form-group m-form__group m-login__form-sub"> <div class="col m--align-left"> <label class="m-checkbox m-checkbox--light"> <input type="checkbox" name="agree">I Agree the <a href="

我有代码要显示:-

<div class="row form-group m-form__group m-login__form-sub">
  <div class="col m--align-left">
    <label class="m-checkbox m-checkbox--light">
      <input type="checkbox" name="agree">I Agree the
      <a href="#" class="m-link m-link--focus">terms and conditions</a>.
      <span></span>
    </label>
    <span class="m-form__help"></span>
 </div>
</div>

我同意
.

那么如何使用FormHelper转换它呢。或者如何创建相同的模板?

这里我提到了cakephp创建复选框的方法。试试吧。希望它能起作用

<div class="row form-group m-form__group m-login__form-sub">
  <div class="col m--align-left">
    <?php echo $this->Form->input('agree', array(
     'type'=>'checkbox','label'=>'I Agree The'));?>
    <a href="#" class="m-link m-link--focus">terms and conditions</a>
</div>


这里我提到了cakephp创建复选框的方法。试试吧。希望它能起作用

<div class="row form-group m-form__group m-login__form-sub">
  <div class="col m--align-left">
    <?php echo $this->Form->input('agree', array(
     'type'=>'checkbox','label'=>'I Agree The'));?>
    <a href="#" class="m-link m-link--focus">terms and conditions</a>
</div>


我可以在$this->Form->input内同时获取两个div吗???@a.shah是的,你可以使用模板,请参考你可以使用的文档。我可以在$this->Form->input内获取两个div吗???@a.shah是的,你可以使用模板,请参考你可以使用的文档。