zend framework - Unable to load template file -


fatal error: uncaught exception 'smartyexception' message 'unable load template file '../index/index.tpl'' in  /var/www/docs/sw.com/public/library/smarty/sysplugins/smarty_internal_template.php:174  stack trace:  #0 /var/www/docs/sw.com/public/library/smarty/sysplugins/smarty_internal_template.php(551): smarty_internal_template->isexisting(true)  #1 /var/www/docs/sw.com/public/application/tmp/smarty_compile/898ca70906754084b81f61d3ce7baee3b11bd8d3.file.layout.tpl.php(46): smarty_internal_template->getrenderedtemplate()  #2 /var/www/docs/sw.com/public/library/smarty/sysplugins/smarty_internal_template.php(436): include('/var/www/docs/s...')  #3 /var/www/docs/sw.com/public/library/smarty/sysplugins/smarty_internal_template.php(568): smarty_internal_template->rendertemplate()  #4 /var/www/docs/sw.com/public/library/smarty/smarty.class.php(328): smarty_internal_template->getrenderedtemplate()  #5 /var/www/docs/sw.com/public/library/smarty/smarty.class.php(370): smarty->fetch('/var/www/docs/s...', null, null, null, true)  #6 /v in /var/www/docs/sw.com/public/library/smarty/sysplugins/smarty_internal_template.php on line 174  

i using smarty template zend framework , in create 1 more module admin.in module controller working , layout.tpl file working problem when add include file syntax in layout.tpl file time same error coming.

indexcontroller.php  <?php  class admin_indexcontroller extends models_usercommoncontroller  {  function init()      {      parent::init();  }  public function indexaction()  {     $this->view->assign('t_body', '../index/index.tpl'); } } ?>  layout.tpl     <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1252" /> <title>{$site_title}</title> </head>  <body>  <p>hello</p>  {include file="$t_body"}  </body> </html>  index.php 

admin

i done same thing in windows working in ubuntu not working. set permissions , check path , all. default module working in ubuntu admin module not working

not sure smarty implementation have remember phps working directory projects root path.

you'd want assign absolutely manner:

$this->view->assign('t_body', __dir__ . '/../index/index.tpl'); 

remember though holds true zend framework 2! code suggests you're not using second version rather zf1. otherwise absolutely should move forward , use namespaces , follow tutorial on how build controllers.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -