Welcome Guest, Not a member yet? Register   Sign In
Phil Sturgeon templating library and Dwoo parser both working, but not together
#1

[eluser]Unknown[/eluser]
Hello happy helpers,

I have Phil Sturgeon's templating extension working - I've tested it. And independently I have the Dwoo parser working, which was recommended in Phil Sturgeon's documentation. But I am not sure how to make the two work together. The following works for me:

Code:
$this->template->title('Page Title', 'Page Title 2');
$this->template->set('foo', 'bar');
$this->template->build('welcome_message');
Code:
<p>&lt;?php echo $foo;?&gt;</p>
<p>&lt;?php echo $template['title'];?&gt;</p>

And this works:
Code:
$this->parser->parse('welcome_message');
Code:
<p>{$foo}</p>

But if I leave my view full of {$foo} and don't call $this->parser but just use $this->template->build then it doesn't parse the braces, it just echoes it as a string.

It is as if the parser isn't being called by the templating class - but the following $config['parser_enabled'] = TRUE; is set in the config.

Where am I going wrong? Why isn't the parser being called by the template class? Thank you in advance.


Messages In This Thread
Phil Sturgeon templating library and Dwoo parser both working, but not together - by El Forum - 12-19-2011, 06:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB