【发布时间】:2013-10-24 19:24:59
【问题描述】:
CakePHP 创建一个 div,该 div 自动包装其使用 formhelper 构建的任何输入标签,如下所示:
$this->formhelper->input('something');
输出如下所示:
<div class='input'>
<input />
</div>
我知道有一种方法可以将类添加到输入标签,即
$this->formhelper->input('text', array('class' => 'some_css'));
但是,您将如何向 CakePHP 自动创建的 div 添加样式。这可能是核心需要被破解的地方,但我想知道是否有更好的方法来做到这一点,以便我得到如下内容:
<div class='input other_class_I_want_here'>
<input />
</div>
感谢任何可以提供帮助的人。
【问题讨论】:
-
对于初学者,我建议阅读documentation - 也可以在这里使用
$this->Form->。
标签: css cakephp cakephp-2.0 html-input