自定义提交按钮
答
还记得,你总是可以做到这一点老同学
我更喜欢使用$this->Form->end();
没有参数,并建立自己的提交按钮和标记。这很容易
<div class="buttons clearfix">
<button type="submit" class="positive">
<span class="icon-wrapper"><img src="path/to/tickmark.png" alt="" title="" /></span>
Save Item
</button>
</div>
我也想告诉你用$this->Form->input('Model.field', 'options' => array(array('type' => 'button')));
实验 - 尤其是之前,之间,之后,和类选项。您可以使用助手创建具有很大灵活性的<input type="button" />
元素。
答
这是不够的:
echo $this->Form->submit("Custom message");
此外,作为@Mike建议与
echo $this->Form->end();
答
关闭窗体或者你可以结合两种:
echo $this->Form->end("Custom Message");
答
您可以创建costum提交通过此代码
echo $this->Form->submit(
'Submit',
array('div' => false,'class' => 'urclass', 'title' => 'Title')
);
答
我在使用内嵌样式用于指定尺寸和改变位置我下的应用程序/ Web根目录/ IMG创建使用图像的自定义按钮,中心
$options=array('type'=>'Make secure payment', 'type'=>'image', 'style'=>'width:200px; height:80px; display:block; margin-left:auto; margin-right:auto;');
echo $this->Form->submit('/img/axiaepaysecurebuttongray_med.png', $options);
echo $this->Form->end();
答
对于CakePHP的2.x中,你可以使用
$options = array(
'label' => 'Update',
'div' => array(
'class' => 'glass-pill',
)
);
echo $this->Form->end($options);
感谢您分享。为你+1 – Pratik 2015-04-16 17:34:23