感谢burzum帮助使用CakePHP配置TwigView。
我能够在CakePHP中使用.tpl扩展名。
然而,并非一切都呈现完美。我的default.tpl布局文件如下
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
{{ html.charset() }}
<title>{{ 'CakePHP: the rapid development php framework'|trans }}: {{ title_for_layout }}</title>
{{ html.meta('icon') }}
{{ html.css('cake.generic') }}
{{ scripts_for_layout }}
</head>
<body>
<div id="container">
<div id="header">
<h1>{{
html.link('CakePHP: the rapid development php framework'|trans, 'http://cakephp.org')
}}</h1>
</div>
<div id="content">
{{ session.flash() }}{{ session.flash('auth') }}
{{ content_for_layout }}
</div>
<div id="footer">
{{
html.image('cake.power.gif', {
'alt': 'Powered by CakePHP'|trans,
'url': 'http://cakephp.org'
})
}}
</div>
</div>
</body>
</html>
然而,它呈现在
之下<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>CakePHP: the rapid development php framework: Testing</title>
</head>
<body>
<div id="container">
<div id="header">
<h1></h1>
</div>
<div id="content">
<div class"alert alert-info>Hello There!</div>
</div>
<div id="footer">
</div>
</div>
</body>
</html>
助手无法渲染。请帮助!
上一篇文章的链接是here