在CakePHP中添加类名
我正在使用CakePHP构建我的应用程序。我想在在CakePHP中添加类名,php,arrays,cakephp,Php,Arrays,Cakephp,我正在使用CakePHP构建我的应用程序。我想在 我尝试将类数组作为第一个数组、中间数组和最后一个数组,所有这些数组都有自己的问题集。从上面的代码可以看出,当前设置的方式并没有观察到类名 我需要做什么来解决这个问题?请帮忙。看看食谱中的文档 它将postLink解释为 FormHelper::postLink(string $title, mixed $url = null, array $options
我尝试将类数组作为第一个数组、中间数组和最后一个数组,所有这些数组都有自己的问题集。从上面的代码可以看出,当前设置的方式并没有观察到类名
我需要做什么来解决这个问题?请帮忙。看看食谱中的文档
它将postLink解释为
FormHelper::postLink(string $title,
mixed $url = null,
array $options = array (),
string $confirmMessage = false)
所以代码的修改版本可以写成
<?php echo $this->Form->postLink('Add to cart',
array('action' => 'add', $inventory['Inventory']['id']),
array('class' => 'btn btn-primary btn-sm'),
'Are you sure?');
?>
FormHelper::postLink(string $title,
mixed $url = null,
array $options = array (),
string $confirmMessage = false)
<?php echo $this->Form->postLink('Add to cart',
array('action' => 'add', $inventory['Inventory']['id']),
array('class' => 'btn btn-primary btn-sm'),
'Are you sure?');
?>