Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
Wednesday, March 24, 2010
Friday, March 19, 2010
[CakePHP] 元件重複利用
靜態頁面
echo $this->renderElement('blah');
動態內容頁面
array based cake style url
This allows the requestAction call to bypass the usage of Router::url which can increase performance.
echo $this->renderElement('blah');
動態內容頁面
requestAction
requestAction(string $url, array $options)
You can use requestAction() to retrieve a fully rendered view by passing 'return' in the options: requestAction($url, array('return'));array based cake style url
$this->requestAction(array('controller' => 'articles', 'action' => 'featured'), array('return'));This allows the requestAction call to bypass the usage of Router::url which can increase performance.
測試結果只有 $options有給 return才有效,沒給return都是no return (another cake bug??)[CakePHP] constant & variable
本機目錄
WWW (...user2/app/webroot)
IMAGES (...user2/app/webroot/img)
...etc
給url使用
$this->webroot (/users2/app/webroot/)
WWW (...user2/app/webroot)
IMAGES (...user2/app/webroot/img)
...etc
給url使用
$this->webroot (/users2/app/webroot/)
Subscribe to:
Posts (Atom)