zend_view

helper output filter variable escaping -&#62;basePath setBasePath addBasePath basePath -&#62;encoding setEncoding encoding -&#62;escape setEscape escape -&#62;filter setFilter addFilter filter -&#62;strictVars setStrictVars strictVars headscript appendfile($scr, $type = 'text/javascript', $attrs = array()); offsetsetfile($index, $scr, $type = 'text/javascript', $attrs = array()); prependfile($scr, $type = 'text/javascript', $attrs = array()); setfile($scr, $type = 'text/javascript', $attrs = array()); appendscript($script, $type = 'text/javascript', $attrs = array()); offsetsetscript($index, $script, $type = 'text/javascript', $attrs = [...]<br /><!-- Feedsky flare --><a href="http://feed.feedsky.com/~flare/bc1998?a=b465e6d029e2bd9ed67ef15c82ca9d8c" target="_blank"><img src="http://feed.feedsky.com/~flare/bc1998?i=b465e6d029e2bd9ed67ef15c82ca9d8c" border="0"></a><a href="http://feed.feedsky.com/~flare/bc1998?a=d55467abee25fb07d5b2937595d716cb" target="_blank"><img src="http://feed.feedsky.com/~flare/bc1998?i=d55467abee25fb07d5b2937595d716cb" border="0"></a><a href="http://feed.feedsky.com/~flare/bc1998?a=70cda198a0b79941d506344fe2f63e4c" target="_blank"><img src="http://feed.feedsky.com/~flare/bc1998?i=70cda198a0b79941d506344fe2f63e4c" border="0"></a><a href="http://feed.feedsky.com/~flare/bc1998?a=db20887a02afdc89d4726873ae7a93bf" target="_blank"><img src="http://feed.feedsky.com/~flare/bc1998?i=db20887a02afdc89d4726873ae7a93bf" border="0"></a><a href="http://feed.feedsky.com/~flare/bc1998?a=dff6523a25a09a1d93629bcbdf07829b" target="_blank"><img src="http://feed.feedsky.com/~flare/bc1998?i=dff6523a25a09a1d93629bcbdf07829b" border="0"></a><a href="http://feed.feedsky.com/~flare/bc1998?a=9ff70c0fc24ff9a6a7fb59fbe75e0dc2" target="_blank"><img src="http://feed.feedsky.com/~flare/bc1998?i=9ff70c0fc24ff9a6a7fb59fbe75e0dc2" border="0"></a><a href="http://feed.feedsky.com/~flare/bc1998?a=5503df6a6bda285205468ecaa86bf2aa" target="_blank"><img src="http://feed.feedsky.com/~flare/bc1998?i=5503df6a6bda285205468ecaa86bf2aa" border="0"></a><a href="http://feed.feedsky.com/~flare/bc1998?a=85abf3a0857f78d9eccd21da8906c4ce" target="_blank"><img src="http://feed.feedsky.com/~flare/bc1998?i=85abf3a0857f78d9eccd21da8906c4ce" border="0"></a><!-- /Feedsky flare -->
阅读更多

zend framework 中zend_view的疑惑

12-28

我在使用zend_view时感觉到很奇怪的事情是在使用script文件时,rnclass PutpostController extends Zend_Controller_Actionrnrn function indexAction()rn rn //Zend_Loader::loadClass('Zend_View');rn $view=new Zend_view();rn $view->setScriptPath('./application/views/scripts/posts');//////视图脚本所在的目录 rn foreach($view->getScriptPaths () as $onepath)rn rn echo $onepath.' ';rn rn $view->render("postnews.phtml");rn rnrn我设置了这个脚本目录后,制定phtml文件,那应该是用这个模板来完成输出吧,可是我执行http://localhost:8082/putpost/时,却提示我找不到scriptrnFatal error: Uncaught exception 'Zend_View_Exception' with message 'script 'putpost/index.phtml' not found in path [color=#FF0000](.\application\views\scripts[/color]\)'rn看上去就是还是使用了他默认的路径了。然后我故意setScriptPath到一个不存在的目录的话,却又是提醒我我那个路径不存在,那也就是说还是要执行路径设置的了?既然这样为什么我指定自己的文件就不行呢,一定要按照默认的putpost/index.phtml来查找(我在这个目录下放置文件后是有用的,但是是以index.phtml来输出而不是以我指定的postnews.phtml。rn还有就是难道在action中一定要制定view吗,我直接用echo,而不制定模板的话感觉也没有任何作用,还是一直在提醒我putpost/index.phtml不存在?rnzend_view和script是这样用的吗?

没有更多推荐了,返回首页