php - CakePHP 1.2.x Warning with themed view only -
when use themed view in app based on cakephp 1.2.10 gives following symptoms:
- the favicon not printed out in source.
the following warning generated:
warning (2): array_merge() [function.array-merge]: argument #2 not array [root\cakephp\cake\libs\router.php, line 754]
warning (2): extract() expects parameter 1 array, null given [root\cakephp\cake\libs\router.php, line 754]
notice (8): undefined variable: escape [root\cakephp\cake\libs\router.php, line 930]
all of these warnings , notice mention to:
[main] - app\webroot\index.php, line 87
the line 87 of file in following code
if (isset($_get['url']) && $_get['url'] === 'favicon.ico') { return; } else { $dispatcher = new dispatcher(); $dispatcher->dispatch($url);//this line 87 } if (configure::read() > 0) { echo "<!-- " . round(getmicrotime() - $time_start, 4) . "s -->"; } //here end of file app\webroot\index.php ?> my app includes cakephp library out application directory. i.e 1 cake of apps.
all of warnings disappeared when switch non-themed view. wonder why got warnings? , how fix them.
i found error due wrong call $html->url() method. call $this->url('/img/logo.png', "full"), should $html->url('/img/logo.png', true).
the call came element file called head.ctp. following full contest warning explaonation:
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 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 array, null given [root\cakephp\cake\libs\router.php, line 754] notice (8): undefined variable: escape [root\cakephp\cake\libs\router.php, line 930
Comments
Post a Comment