yii,CI,yaf框架+smarty模板使用方法(3)

[common] application.directory = APP_PATH "/application" application.dispatcher.catchException = TRUE application.view.ext="tpl" [smarty : common] ;configures for smarty smarty.left_delimiter = "{#" smarty.right_delimiter = "#}" smarty.template_dir = APP_PATH "/application/views/" smarty.compile_dir = '/data1/www/cache/' smarty.cache_dir = '/data1/www/cache/' [product : smarty]

3.5,验证

新建一个controller,添加方法:

public function twoAction() { $this->getView()->assign('content', 'hello World'); }

新建一个模板two.tpl

<html> <head> <title>A Smarty Adapter Example</title> </head> <body> {#$content#} </body> </html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/a66abbea4a67e71ebea56405afb0ad4a.html