Codeigniter template Parser not working? #349

Closed
antoniofrignani opened this Issue Mar 6, 2012 · 5 comments

Projects

None yet

3 participants

@antoniofrignani
Contributor

Hello everyone,
i am trying to enable CI default template parser inside Bonfire.

I added the parser library as autoloaded in config.php and
$config['template.parse_views'] = TRUE;

inside config/application.php

I get this in my front controller:

An Error Was Encountered

Unable to locate the file: C:\WampDeveloper.-------- omissis -----/themes/manage-theme/manage.php

If i remove the line from application.php, all goes fine.

If I disable the parser library, i catch the error to be at line 889 of template.php library:

$output = self::$ci->parser->parse($view_path . $view, $data, true);

Has anyone got this issue also?

*Edit: i'm on branch develop (0.6-dev)

@antoniofrignani
Contributor

The problem is still alive, i could not get ahead. Can someone watch into this? I think it is a major issue with the template library, but i have resolved pratically nothing, just hacking into...

@seandowney
Member

//cc @lonnieezell do you know why the parse wouldn't work in the Template lib?

@lonnieezell
Member

I haven't checked with the develop branch, but I did just confirm that it works on the sd_merge branch (which is very close to being the default develop branch).

It sounds like the issue that I had when we made the switch to CI 2.0 branch, but I don't know why it would be set like that again. Try replacing line 889 with the following:

$output = self::$ci->parser->parse($view, $data, true);

If that doesn't fix it, I'd be tempted to say try to grab the template library from the feature/sd_merge branch and replacing yours to see if that fixes it.

@antoniofrignani
Contributor

//cc @lonnieezell : Both your proposed solutions doesn't seems to fix the issue. Everytime i get an error saying that the file containing the view can't be found.

I had time to hack into a little bit, finding a temporary solution like this:

File: library/template.php - Line: 887-888

$output = self::$ci->parser->_parse($template, self::$data, true);

I am not sure if this is the correct way to manipulate the view content via the parser engine.
ATM the fix works, but i havent done extensive tests.

Do you see any issue with this code?

@svizion svizion added a commit that referenced this issue May 15, 2012
@svizion svizion Ref issue #349 - verifiying the parser is loaded and sanitizing all $…
…data in the view.

Check and loads CI_Parser if not loaded, loops through all view data and converts any object
into a array.

//cc @antoniofrignani @seandowney @lonnieezell
46a6273
@lonnieezell
Member

I believe this works in 0.6 now without issue. I'm marking closed for now. Reopen if needed.

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