-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
How to do the following #214
Comments
I know the routers and screenshot do not match, ignore that. Conceptionally I want to understand how I can send the route to a specific PHP file in the controller. example $router->get('/user', 'User/index.php'); |
This is how I currently do it, but it feels... dirty. // Define routes
$router->get('/', include_once '../App/Controllers/User/index.php'); |
Hi Erik,
to import the file there are two ways:
Youtube How to autoload: |
Maybe this helps to see, besides passing the function by name / reference you can also define an anonymous function in it itself (shown here, but rather quick and dirty) |
The text was updated successfully, but these errors were encountered: