Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.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
在CakePHP中添加类名_Php_Arrays_Cakephp - Fatal编程技术网

在CakePHP中添加类名

在CakePHP中添加类名,php,arrays,cakephp,Php,Arrays,Cakephp,我正在使用CakePHP构建我的应用程序。我想在 我尝试将类数组作为第一个数组、中间数组和最后一个数组,所有这些数组都有自己的问题集。从上面的代码可以看出,当前设置的方式并没有观察到类名 我需要做什么来解决这个问题?请帮忙。看看食谱中的文档 它将postLink解释为 FormHelper::postLink(string $title, mixed $url = null, array $options

我正在使用CakePHP构建我的应用程序。我想在

我尝试将类数组作为第一个数组、中间数组和最后一个数组,所有这些数组都有自己的问题集。从上面的代码可以看出,当前设置的方式并没有观察到类名

我需要做什么来解决这个问题?请帮忙。

看看食谱中的文档 它将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?');
?>