我有一个取消按钮,我想在everything.ctp页面上重定向,我还在ApplicationsController中有一个函数everything()。以下是取消按钮代码:
<div class="col-md-6">
<input type="submit" name="submit" value="Submit" class="btn btn-primary ">
<a href="" class="btn btn-info">Cancel</a>
</div>
答案 0 :(得分:0)
我解决了这个问题。我只是给了href中的url。检查以下代码:
<div class="row">
<div class="col-md-6">
<input type="submit" name="submit" value="Submit" class="btn btn-primary ">
<a href="http://localhost:7777/eman_test/applications/everything"
class="btn btn-info">Cancel</a>
</div>
答案 1 :(得分:0)
最好以“CakePHP”方式进行:
<div class="col-md-6">
<?php
echo $this->Form->input('submit', ['type'=>'submit', 'value'=>'Submit', 'class'=>'btn btn-primary']);
echo $this->Html->link(__('Cancel', ['controller' => 'Applications', 'action' => 'everything'], ['class' => 'btn btn-info', 'escape' => false]);
?>
</div>