CakePHP 1.2.x警告,仅限主题视图
当我在基于CakePHP 1.2.10的应用程序中使用主题视图时,会出现以下症状:CakePHP 1.2.x警告,仅限主题视图,php,cakephp,warnings,cakephp-1.2,Php,Cakephp,Warnings,Cakephp 1.2,当我在基于CakePHP 1.2.10的应用程序中使用主题视图时,会出现以下症状: favicon没有在源文件中打印出来 将生成以下警告: 警告(2):array_merge()[function.array merge]:参数#2不是数组[ROOT\cakephp\cake\libs\router.php,第754行] 警告(2):extract()要求参数1为数组,给定为空[ROOT\cakephp\cake\libs\router.php,第754行] 注意(8):未定义的变量:escap
if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
return;
} else {
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch($url);//This is line 87
}
if (Configure::read() > 0) {
echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";
}
//Here is the end of the file APP\webroot\index.php
?>
if(isset($\u-GET['url'])&&&$\u-GET['url']=='favicon.ico'){
返回;
}否则{
$Dispatcher=newdispatcher();
$Dispatcher->dispatch($url);//这是第87行
}
if(Configure::read()>0){
回声“;
}
//下面是文件APP\webroot\index.php的结尾
?>
我的应用程序包括应用程序目录中的CakePHP库。i、 为我所有的应用程序准备一块蛋糕
当我切换到非主题视图时,所有这些警告都消失了。我想知道为什么我会收到这些警告?我发现这个错误是由于对$html->url()方法的错误调用造成的。我叫它$this->url('/img/logo.png',“full”),但它应该是$html->url('/img/logo.png',true) 调用来自名为head.ctp的元素文件。 以下是完整的比赛警告说明:
array_merge - [internal], line ??
Router::url() - ROOT\cakephp\cake\libs\router.php, line 754
Helper::url() - ROOT\cakephp\cake\libs\view\helper.php, line 177
include - APP\views\themed\slate\elements\head.ctp, line 15 //HERE IS THE Mistaken Call
View::_render() - ROOT\cakephp\cake\libs\view\view.php, line 665
View::element() - ROOT\cakephp\cake\libs\view\view.php, line 342
include - APP\views\themed\slate\layouts\blog.ctp, line 1
View::_render() - ROOT\cakephp\cake\libs\view\view.php, line 665
View::renderLayout() - ROOT\cakephp\cake\libs\view\view.php, line 453
View::render() - ROOT\cakephp\cake\libs\view\view.php, line 387
Controller::render() - ROOT\cakephp\cake\libs\controller\controller.php, line 808
Dispatcher::_invoke() - ROOT\cakephp\cake\dispatcher.php, line 229
Dispatcher::dispatch() - ROOT\cakephp\cake\dispatcher.php, line 193
[main] - APP\webroot\index.php, line 88
Warning (2): extract() expects parameter 1 to be array, null given [ROOT\cakephp\cake\libs\router.php, line 754]
Notice (8): Undefined variable: escape [ROOT\cakephp\cake\libs\router.php, line 930