Route
class and defining the HTTP verb you would like with the URL and the controller you would like to use. These routes need to be wrapped in a ROUTES
list inside your routes file./welcome
URL.{ControllerClass}@{controller_method}
:__call__
method of the class will be bound to this route. It means that you should define this method in your controller:__call__
method of the class will be bound to this route. It means that you should define this method in your controller:@
symbol:/dashboard/user
and /dashboard/user/settings
to the same controller method. In this event you can use optional parameters which are simply replacing the @
symbol with a ?
:@user_id
is an integer. You can do this by appending a :
character and compiler name to the parameter:integer
int
(alias for integer)string
signed
register_routes()
method in your Kernel.py
file.Note: The compile methods need to happen before the routes are loaded in this method so make sure it is at the top. You may also put it in any method that appears before theregister_routes()
method.
group()
method that accepts a list of routes and keyword arguments for the options:dashboard.settings
with a URL of /dashboard/settings
and dashboard.monitor
and a URL of /dashboard/monitor
.routes:list
Masonite command. Routes will be displayed in a table with relevant info such as route name, methods, controller and enabled middlewares for this route.