Main
in package
The main class responsible for initializing the Slim application and running it.
Tags
Table of Contents
- main() : void
- Entry point of the application.
- addApiRoutes() : void
- Adds the API routes to the given Slim application.
- addApiRoutesForControllers() : void
- Add API routes to the given RouteCollectorProxy.
- addClassToContainer() : T
- Adds the given class to the container and returns an instance of it.
- getContainer() : Container
- Creates and returns a container with all the dependencies.
Methods
main()
Entry point of the application.
public
static main() : void
Initializes and runs the Slim application.
Return values
void —addApiRoutes()
Adds the API routes to the given Slim application.
private
static addApiRoutes(App $router) : void
Parameters
- $router : App
-
The Slim application to add the routes to.
Return values
void —addApiRoutesForControllers()
Add API routes to the given RouteCollectorProxy.
private
static addApiRoutesForControllers(RouteCollectorProxy $group) : void
Parameters
- $group : RouteCollectorProxy
-
The Slim RouteCollectorProxy for adding routes.
Return values
void —addClassToContainer()
Adds the given class to the container and returns an instance of it.
private
static addClassToContainer(Container $container, class-string<\App\T> $class[, array<string|int, mixed> $params = [] ]) : T
Parameters
- $container : Container
-
The container to add the class to.
- $class : class-string<\App\T>
-
The class to add to the container.
- $params : array<string|int, mixed> = []
-
The parameters to pass to the class constructor.
Tags
Return values
T —An instance of the given class.
getContainer()
Creates and returns a container with all the dependencies.
private
static getContainer() : Container
Return values
Container —The container with all the dependencies.