Docs / API Reference / Controller
If you're looking for the walkthrough guide on Controllers, see: 2.1 Controller
Trails Controller classes are singletons; that is, each subclassed Controller is instantiated once, and that reference is maintained during the life of the program.
Initialize the Controller with the provided app
instance.
@param | type | description | required? |
---|---|---|---|
app |
Trails |
the Trails application instance | yes |
None.
Return the id of the Controller. e.g. for UserController
, the id
will be user
.
The application's Logger instance. Convenience reference for this.app.log
.
The i18n translator instance. Convenience reference for this.app.__
.
Convenience reference to this.app.services
.