Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found a bug in template library, when set theme is not call might cause error #1

Open
keatliang2005 opened this issue Nov 9, 2010 · 3 comments

Comments

@keatliang2005
Copy link

when it's not call $this->template->set_theme($theme) on controller,

and the configuration default theme is set to
$config['theme'] = $theme;

libraries/Template.php#L80
at line 80 will cause the problem, due to for-loop ascending nature

foreach ($config as $key => $val)
{
if ($key == 'theme' AND $val != '')
{
$this->set_theme($val); // executed at first because $config['theme'] first
continue;
}

$this->{'_'.$key} = $val; //then $config['theme_locations'] is the last statement
}

sorry for my bad english. ;-)

@dfreerksen
Copy link
Contributor

I think you and I found the same issue. This should be fixed in changeset 22a6dcd Can you re-download and test it out?

@JANorman
Copy link

I think that this issue still slightly exists :-( It appears that although the set_theme() call is being made, it is completley ingnored when handling the layouts.

For example, in my controller i have:
$this->template->set_theme('mytheme')->set_layout('lays')->build('myview', $data);

When building, it is trying to build the layout located at "views/layouts/lays.php" instead of "themes/mytheme/layouts/lays.php" (ive altered the core to find out what file its trying to load)\

Im looking into the problem right now, but any suggestions would be greatley appreciated.

James

@jessedc
Copy link

jessedc commented Jun 28, 2011

JANorman, if you look closely at the get_theme_layouts() function and _find_view_folder() Template is looking for the layout files within [themes dir]/mytheme/views/layouts/layoutfile.php. The 'views' folder inbetween the theme folder and the layouts folder isn't immediately obvious.

I found the documentation to be a bit inconsistent and had to resort to the code to work that out.

I hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants