[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>