Hi every: I've working in my first project based on Symfony 1.3 and Twig (latest). For that I check first the doc but I missing something because I'm getting a error. See what I've done.
class installActions extends sfActions { public function preExecute() { require_once(sfConfig::get('sf_lib_dir').'/twig/sfTemplateAutoloader.php'); sfTemplateAutoloader::register(); } public function executeIndex(sfWebRequest $request) { $helperSet = new sfTemplateHelperSet(array( new sfTemplateHelperJavascripts(), new sfTemplateHelperStylesheets(), )); $loader = new sfTemplateLoaderFilesystem(sfConfig::get('sf_web_dir').'/themes/%name%.php'); $engine = new sfTemplateEngine($loader, array(), $helperSet); echo $engine->render('frontend/index'); } Then my templates are located under: /web /themes /default /frontend index.php /css style.css /images /js layout.php The code for layout.php is this one: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $sf_user->getCulture() ?>" lang="<?php echo $sf_user->getCulture() ?>"> <head> <title> <?php $this->output('title', 'Sistema de Gestión de Incidencias v0.1') ?> <?php echo $this->get('title', 'Sistema de Gestión de Incidencias v0.1') ?> <?php if (!$this->output('title')): ?> Sistema de Gestión de Incidencias v0.1 <?php endif; ?> </title> <?php include_http_metas() ?> <?php include_metas() ?> <?php $this->stylesheets->add('/css/style.css') ?> </head> <body> <div id="wrapper"> <div id="header"> </div> <div id="navbar"> </div> <div id="center"><?php echo $this->get('content') ?></div> <div id="footer"><p> © copyright 2009 <strong><?php echo __('compania') ?></strong> | <?php echo __('Valid: ') ?> <a href="http://validator.w3.org/check/referer">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></p></div> </div> </body> </html> And the code for index.php is just a Hello World for testing purpose. When I try to render the page I get this error: 500 | Internal Server Error | InvalidArgumentException The template "frontend/index" does not exist (renderer: php). stack trace * at () in SF_ROOT_DIR\lib\twig\sfTemplateEngine.php line 87 ... 84. 85. if (false === $template) 86. { 87. throw new InvalidArgumentException(sprintf('The template "%s" does not exist (renderer: %s).', $name, $renderer)); 88. } 89. 90. $this->current = $name; * at sfTemplateEngine->render('frontend/index') in SF_ROOT_DIR\apps\frontend\modules\install\actions\actions.class.php line 91 ... 88. $loader = new sfTemplateLoaderFilesystem(sfConfig::get('sf_web_dir').'/themes/%name%.php'); 89. $engine = new sfTemplateEngine($loader, array(), $helperSet); 90. 91. echo $engine->render('frontend/index'); 92. } Where is the error here? What I'm missing? Cheers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---