【问题标题】:Cakephp 3: how to add class to wrapper of input checkbox element and put class on label/input field?Cakephp 3:如何将类添加到输入复选框元素的包装器并将类放在标签/输入字段上?
【发布时间】:2019-07-17 20:31:51
【问题描述】:

我需要在默认的“输入复选框”div 旁边添加引导自定义复选框类并将类添加到标签,以便我可以使用 cakephp 3 表单助手获得引导复选框布局。

【问题讨论】:

    标签: html bootstrap-4 cakephp-3.0


    【解决方案1】:
    $this->Form->control('status', [
      'class' => 'custom-control-input',
      'templates' => [
        'inputContainer' => '<div class="custom-control custom-checkbox input {{type}}{{required}}">{{content}}</div>',
        'nestingLabel' => '{{input}} <label{{attrs}} class="custom-control-label">{{text}}</label>'
      ],
    ]);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-21
      • 1970-01-01
      • 1970-01-01
      • 2018-10-04
      • 1970-01-01
      • 2018-06-11
      相关资源
      最近更新 更多