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

App->render() seems not to work during "after" event #7

Closed
scogle opened this issue Jul 1, 2014 · 1 comment
Closed

App->render() seems not to work during "after" event #7

scogle opened this issue Jul 1, 2014 · 1 comment

Comments

@scogle
Copy link

scogle commented Jul 1, 2014

I'm working more or less directly from the the Events example in the readme. When I try to render 404.php I get two errors:

[01-Jul-2014 20:52:26 UTC] PHP Warning: include(views/404.php): failed to open stream: No such file or directory in /Users/scott/Sites/Semantic_Redesign/cockpit/vendor/Lime/App.php on line 529

and

[01-Jul-2014 20:52:26 UTC] PHP Warning: include(): Failed opening 'views/404.php' for inclusion (include_path='.:/Applications/MAMP/bin/php/php5.4.4/lib/php') in /Users/scott/Sites/Semantic_Redesign/cockpit/vendor/Lime/App.php on line 529

I'm able to render templates normally (i.e. when there's a defined route using bind()) but not during the after event.

@ghost
Copy link

ghost commented Jul 22, 2014

There is an easy workaround. Just add this line just after you created your app
$app->path('views', DIR.'/views');
After that just use such kind of calls (not that we use : instead of /)
$app->response->body = $app->render("views:404.php");

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

2 participants