philsturgeon/codeigniter-template — Issue #24: Error Message when using the themes directory --> libraries/Template.php
Author: webstone
Created: 2011-11-20 18:21:45+00:00
State: open

Hi,

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

When i moved the module views to my theme directory i got always the 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

```php
$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:

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

It works fine.