【问题标题】:Translating html input into cake php input convention将 html 输入转换为 cake php 输入约定
【发布时间】:2011-12-11 17:32:49
【问题描述】:

我的提交按钮有问题,我认为是因为我只是将其保留为常规格式 echo $this->Form->end('Submit') 但实际上我想将这些属性转换为 CakePHP <input type="submit" value="Submit" name="submitrating" class="button"/>

如何在 CakePHP html 帮助表单中的提交按钮上创建这些属性?,我正在从传统的 php 网站切换到蛋糕 php。

谢谢

【问题讨论】:

    标签: cakephp


    【解决方案1】:

    您可以通过passing them as an array添加属性。

    $this->Form->end(
        array(
            'label' => 'Submit',
            'name'  => 'submitrating',
            'class' => 'button'
        )
    );
    

    【讨论】:

    • 没有。另请参阅the API,它通过大量示例很好地解释了这一点。
    猜你喜欢
    • 2015-08-29
    • 2012-06-22
    • 2021-06-03
    • 2012-09-27
    • 2010-10-20
    • 1970-01-01
    • 1970-01-01
    • 2017-07-22
    • 2013-03-20
    相关资源
    最近更新 更多