Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

No views using Smarty with CodeIgniter

 
Post new topic   Reply to topic    Smarty Forum Index -> Frameworks
View previous topic :: View next topic  
Author Message
johnc
Smarty n00b


Joined: 18 Jun 2014
Posts: 4

PostPosted: Wed Jun 18, 2014 3:54 am    Post subject: No views using Smarty with CodeIgniter Reply with quote

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
View user's profile Send private message
johnc
Smarty n00b


Joined: 18 Jun 2014
Posts: 4

PostPosted: Wed Jun 18, 2014 4:05 am    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Wed Jun 18, 2014 4:48 am    Post subject: Reply with quote

It's looking into the template folders of Smarty.

You can get them with $dir=$smarty->getTemplateDir();
Back to top
View user's profile Send private message
johnc
Smarty n00b


Joined: 18 Jun 2014
Posts: 4

PostPosted: Wed Jun 18, 2014 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Frameworks All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP