2013-11-24 76 views
0

感谢burzum帮助配置TwigView与CakePHP。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

我使用predominant cakephp plugin

回答

0

感谢Alex问题已解决。

我从另一个帖子here得到了答案。

我们有明确的声明在控制器中的助手,使其工作:

public $helpers = array('Html');