Treaty
abstract class Treaty (View source)
Constants
| SLASH |
|
| NOSLASH |
|
Properties
| static protected string[] | $allowedMethods |
Methods
bool
mount()
Scans public instance methods and registers matching ones as routes.
static
dispatch(int $modes = 0)
Instantiates the controller and dispatches its routes against the global $app.
static string
formatPath(string $path)
Converts a class method suffix to a kebab-case URL segment.
Details
__construct(App $context, int $modes)
Create routes basead in a Controller or other Class
bool
mount()
Scans public instance methods and registers matching ones as routes.
Returns true if at least one route was registered, false otherwise.
static
dispatch(int $modes = 0)
Instantiates the controller and dispatches its routes against the global $app.
Intended as a one-line convenience call from route definition files. Throws if the global $app is unavailable or no routes are found.
static protected string
formatPath(string $path)
Converts a class method suffix to a kebab-case URL segment.
Examples:
public function postFooBarBaz()becomesfoo-bar-baz.public function getUserID()becomesuser-id. Note: Override this method to customize path formatting.