CakePHP Html->;链接和表单->;结束

CakePHP Html->;链接和表单->;结束,cakephp,Cakephp,我有这个链接,我用来为我的模态 <?php echo $this->Html->link('Create Schedule', '#', array('id' => 'createSchedule', 'class' => 'btn btn-success', 'role' => 'button', )); ?> 如何将其转换为$this->Form->end()格式 谢谢大家! 你可以试试这个 <?php $options =

我有这个链接,我用来为我的模态

<?php 
echo $this->Html->link('Create Schedule', '#', array('id' => 'createSchedule', 'class' => 'btn btn-success', 'role' => 'button', )); 
?>

如何将其转换为$this->Form->end()格式

谢谢大家!

你可以试试这个

<?php
    $options = array(
        'label' => 'Create Schedule',
        'id'    => 'createSchedule',
        'class' => 'btn btn-success'
    );
    echo $this->Form->end($options);
?>

您也可以这样做

<?php
echo $this->Form->button("Create Schedule", array("id" => "createSchedule", "class" => "btn btn-success", "type" => "submit"));
echo $this->Form->end();
?>

或者你也可以这样做

<?php
echo $this->Form->submit("Create Schedule", array("id" => "createSchedule", "class" => "btn btn-success"));
echo $this->Form->end();
?>

你的问题毫无意义。HtmlHelper::link()和FormHelper::end()生成不同的标记。他们完全没有关系。