|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
johnc Smarty n00b
Joined: 18 Jun 2014 Posts: 4
|
Posted: Wed Jun 18, 2014 3:54 am Post subject: No views using Smarty with CodeIgniter |
|
|
I have integrated Smarty with CodeIgniter but I am getting nothing displayed and no errors.
I stepped through the code with the debugger and the smarty functions were being called but nothing is displayed.
I set a break at:
$this->smarty->view('home');
and stepped into the code at:
$this->fetch($template, $cache_id, $compile_id, $parent, true);
inside this function it threw an exception.
throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}");
Any idea what is going on? |
|
Back to top |
|
johnc Smarty n00b
Joined: 18 Jun 2014 Posts: 4
|
Posted: Wed Jun 18, 2014 4:05 am Post subject: |
|
|
Additional information:
In Smarty_Internal_TemplateBase
when I get to:
// checks if template exists
if (!$_template->source->exists) {
this fails.
Is the source referenced here the file index.tpl?
Where is it looking for it, in the views folder? It's there. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Jun 18, 2014 4:48 am Post subject: |
|
|
It's looking into the template folders of Smarty.
You can get them with $dir=$smarty->getTemplateDir(); |
|
Back to top |
|
johnc Smarty n00b
Joined: 18 Jun 2014 Posts: 4
|
Posted: Wed Jun 18, 2014 5:35 am Post subject: |
|
|
The call gave me the required folder.
The documentation I had didn't say anything about the /application/views/templates folder.
I also saw that I needed the folder /application/views/compiled, which I also didn't have.
Once I had those two folders it worked as expected.
I've been spinning my wheels on this one all day.
Thank you VERY much.
John |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|