Skip to content

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

Description

@drmikecrowe

Hi folks,

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

Error:

  • require_once(/var/www/system/../themes//lib/function.php) [function.require-once]: failed to open stream: No such file or directory
  • File: /var/www/themes/basic/views/partials/default/header.php

(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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions