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

Fatal error #9

Closed
whatthefork opened this issue Aug 23, 2018 · 3 comments
Closed

Fatal error #9

whatthefork opened this issue Aug 23, 2018 · 3 comments

Comments

@whatthefork
Copy link

whatthefork commented Aug 23, 2018

An error occurs if the route's function or class method doesn't exist before adding a route. Taht condition generates a fatal error before the jetrouter can throw its own exception:

Fatal error: Uncaught Error: Using $this when not in object context in /var/www/jetrouter/src/RouteParser.php:78

I was calling addRoute like this, but had not yet written the get_dashboard class method into the code.

$router->addRoute( 'GET', 'dashboard', 'dashboard_route', __CLASS__ . '::get_dashboard' );

@sformisano
Copy link
Owner

Hey @whatthefork I haven't had time to properly maintain jetrouter and saw you forked it, was it to fix this issue?

@restless-khai
Copy link

Hey! Got the same issue, will proposed a fix.

@restless-khai
Copy link

#17 Here's a fix.

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

3 participants