Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html元素中的表单元素在cakephp中不起作用_Cakephp_Cakephp 3.0 - Fatal编程技术网

html元素中的表单元素在cakephp中不起作用

html元素中的表单元素在cakephp中不起作用,cakephp,cakephp-3.0,Cakephp,Cakephp 3.0,我已经阅读了文档并尝试了所有可能的解决方案,但没有任何收获 这是我的html代码 <?php echo $this->Html->link( $this->Form->button("Continue", ["type" => "button", "class"=>"btn btn-dark btn-theme-colored btn-flat mr-5"]), array( 'controller' => 'my_controller', 'ac

我已经阅读了文档并尝试了所有可能的解决方案,但没有任何收获

这是我的html代码

<?php echo $this->Html->link(
$this->Form->button("Continue", ["type" => "button", "class"=>"btn btn-dark btn-theme-colored btn-flat mr-5"]),
array(
'controller' => 'my_controller',
'action' => 'my_action'
));?>

我想在
标记中有一个按钮,但它正在输出“”标记中的按钮

这就是我想要的

<i>
   <button></button>
</i>

除非使用转义选项禁用此行为,否则所有特殊字符都将转换为html实体。下面的代码应输出所需的内容:

<?php echo $this->Html->link(
$this->Form->button("Continue", ["type" => "button", "class"=>"btn btn-dark 
btn-theme-colored btn-flat mr-5"]),
array(
    'controller' => 'my_controller',
    'action' => 'my_action'
),
array(
    'escape' => false
));?>


有关HTML帮助程序的更多信息,请参见此处:

所有特殊字符都将转换为HTML实体,除非您使用转义选项禁用此行为。下面的代码应输出所需的内容:

<?php echo $this->Html->link(
$this->Form->button("Continue", ["type" => "button", "class"=>"btn btn-dark 
btn-theme-colored btn-flat mr-5"]),
array(
    'controller' => 'my_controller',
    'action' => 'my_action'
),
array(
    'escape' => false
));?>


关于HTML helper的更多信息可以在这里找到:

为什么要同时使用这两个数组?我的意思是为什么我可以将escape放在
操作之后
大多数HtmlHelper方法都将options数组作为第二个参数,但是HtmlHelper::link()not-该方法中的第二个参数是为url保留的。若要为链接指定选项,您需要提供额外的数组作为第三个参数。为什么要同时使用这两个数组?我的意思是为什么我可以在
操作
后放置escape大多数HtmlHelper方法将选项数组作为第二个参数,但HtmlHelper::link()not-该方法中的第二个参数是为url保留的。若要为链接指定选项,需要提供附加数组作为第三个参数。