CakePHP Html->link and Form->end



我有这个链接,用于我的模式

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

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

谢谢!

您也可以这样做

<?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();
?>

你可以试试这个

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

最新更新