philsturgeon / codeigniter-template

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

Can't find functions.php if parsing view #42

Open drmikecrowe opened 12 years ago

drmikecrowe commented 12 years ago

Hi folks,

I'm using Template with Dwoo, and when parsing the view, I get this error:

Error:

(notice how the theme 'basic' is missing from the header.php require)

However, I can fix it by adding the following $this->_ci->load->vars($data); in the _load_view() as below:

Is this ok? I don't know enough about the code to evaluate if this will break something.

private function _load_view($view, array $data, $parse_view = TRUE, $override_view_path = NULL)
{
    // Sevear hackery to load views from custom places AND maintain compatibility with Modular Extensions
    if ($override_view_path !== NULL)
    {
        if ($this->_parser_enabled === TRUE AND $parse_view === TRUE)
        {
            $this->_ci->load->vars($data);
            // Load content and pass through the parser
            $content = $this->_ci->parser->parse_string($this->_ci->load->file(
                $override_view_path.$view.self::_ext($view), 
                TRUE
            ), $data);
        }
(snip)

TIA Mike