PHP Zealots
เหล่าสาวก PHP เชิญทางนี้ ... Blog, บทความ PHP
Home
Blogs
Latest Version
Forums
News
About Site
Home
›
Blogs
›
roteee's blog
ไม่ต้องการ render Layout และ/หรือ View ใน Zend Framework หรือ ZF
PHP Frameworks
zend framework
Zend_View
zf
Thu, 2010-07-29 15:07
ในบางครั้งเราอาจไม่ต้องการ render view และ/หรือ layout เช่นกรณีเราทำ Ajax Controller ก็ไม่อยากจะแสดง layout รวม อยากแสดงแค่ json หรือ xml เราก็เซตได้ครับ ดังนี้ครับ
$this
->_helper->
layout
->
disableLayout
(
)
;
$this
->_helper->
viewRenderer
->
setNoRender
(
TRUE
)
;
โดยแป่ะไว้ที่ action เกี่ยวข้อง หรือ ไว้ใน init() ของ controller ที่เกี่ยวข้องก้ได้ แล้วแต่สะดวกครับ
roteee's blog
Login
to post comments
25 reads
Navigation
Login
Create content
อ่านข่าวที่ Feed มา
Who's online
There are currently
0 users
and
8 guests
online.
Support GoPHP5
©2007-2010
PHPZealots.com
. All right reserved.