-
Notifications
You must be signed in to change notification settings - Fork 10
App Route Shorthand
Devin Smith edited this page Dec 13, 2015
·
3 revisions
The App object exposes and forwards the get
, post
and when
methods to its $this->router()
method for shorthand route creation. All arguments passed theses functions are passed on to the router.
$app->get('user/:name', function($Params) {
echo $Params->name;
});
or
$app->when([
'route' => 'user/:name',
'method' => 'get',
'controller' => function($Params) {
echo $Params->name
}
]);
See Routes for more information.
- Home
- Getting Started
- Server Config
- Installation
- Installing Composer
- App
- Route Shorthand
- Config
- Routes
- Methods
- Controller Types
- Params & Regex
- Aliases
- Dependency Injection
- Advanced Routing
- Services
- User Defined Services
- Built in Services
- Middleware
- Views
- Templates
- Scope
- Resource
- Factory
- Looper
- Examples
- Plugins
- About