philsturgeon / codeigniter-template

Template library for CodeIgniter which supports modules, themes, partial views, etc.
411 stars 178 forks source link

Error Message when using the themes directory --> libraries/Template.php #24

Closed noxify closed 9 years ago

noxify commented 12 years ago

Hi,

i tested a bit with the template library and HMVC and all works fine as long the views are ONLY in the module directory.

After moving the module views to the theme directory i got always the following error message

A PHP Error was encountered

Severity: Notice

Message: Undefined index: body

Filename: layouts/default.php

Line Number: 3

After some debugging, I found the bad line in the libraries/Template.php in line 263

$this->_body =  self::_load_view('layouts/'.$this->_layout, $this->_data, TRUE, self::_find_view_folder());

The parameter TRUE is hardcoded. I checked the other function which execute the _load_view() function and there are always variables at the third position.

After changing the line to:

$this->_body =  self::_load_view('layouts/'.$this->_layout, $this->_data, $this->_parser_body_enabled, self::_find_view_folder());

It works fine.

skvorets commented 12 years ago

Had the same issue with HMVC. Thank you for the solution!

senda commented 12 years ago

Same issue here, i applied your modification and worked like a charm. Thanks

ghost commented 12 years ago

Good catch.

hrydi commented 8 years ago

nice, thanks for info :dancer: it works now