Томица Кораћ
Томица Кораћ

Reputation: 2662

Codeigniter & Phil Sturgeon's Template Library - Can I put view partials in a theme folder?

I'm using Phil Sturgeon's Template Library in my CI installation. When I try to put view partials' files in a theme folder, they do get called properly, but if I try to echo a $template variable in them, I get an error message saying that $template variable isn't defined. If I place those same view partials in the root views folder, $template is echoed properly.

How can I have view partials inside a theme and pass $template to them at the same time?

Upvotes: 2

Views: 897

Answers (1)

Adrian Gonzales
Adrian Gonzales

Reputation: 1010

I was encountering the same problem. This looks like its a problem with some fancy hacks Phil had to use for compatibility with Modular Extensions.

If you're not using a parser, simply turn off parser_enabled in the template config file. Its the first option. Then it'll work.

If you're using a parser, you'll have to dig into the library. The problem is in the _load_view function, check lines 725-728. Something needs to be done here to get the variables to the parsed template.

Upvotes: 1

Related Questions