ApplicationMixin
class ApplicationMixin (View source)
Can be applied to your App class via a "@mixin" annotation for better IDE support.
This class is not meant to be used in any other capacity.
Methods
Get whether the application has been bootstrapped.
Bootstrap the application.
Get the IoC container instance.
Set the IoC container instance.
Resolve a dependency from the IoC container.
Get the Application instance.
Get the ClosureFactory instance.
Run a full middleware + handler pipeline independently of routes.
Get the ResponseService instance.
Create a "blank" response.
Create a response with the specified string as its body.
Create a response with the specified data encoded as JSON as its body.
Create a redirect response.
Create a response with the specified error status code.
Get the ViewService instance.
Create a view.
Output child layout content.
Create a new route.
Output the specified view.
Details
at line 38
static boolean
isBootstrapped()
Get whether the application has been bootstrapped.
at line 47
static void
bootstrap(array $config = [], boolean $run = true)
Bootstrap the application.
at line 55
static Container
container()
Get the IoC container instance.
at line 64
static void
setContainer(Container $container)
Set the IoC container instance.
at line 72
static mixed|null
resolve(string $key)
Resolve a dependency from the IoC container.
at line 82
static Application
app()
Get the Application instance.
at line 90
static ClosureFactory
closure()
Get the ClosureFactory instance.
at line 127
static ResponseInterface
run(RequestInterface $request, string[] $middleware, string|Closure $handler, array $arguments = [])
Run a full middleware + handler pipeline independently of routes.
at line 135
static ResponseService
responses()
Get the ResponseService instance.
at line 144
static ResponseInterface
response()
Create a "blank" response.
at line 154
static ResponseInterface
output(string $output)
Create a response with the specified string as its body.
at line 164
static ResponseInterface
json(mixed $data)
Create a response with the specified data encoded as JSON as its body.
at line 173
static RedirectResponse
redirect()
Create a redirect response.
at line 183
static ResponseInterface
error(integer $status)
Create a response with the specified error status code.
at line 191
static ViewService
views()
Get the ViewService instance.
at line 201
static ViewInterface
view(string|string[] $views)
Create a view.
at line 210
static void
layoutContent()
Output child layout content.
at line 218
static RouteBlueprint
route()
Create a new route.
at line 230
static void
render(string|string[] $views, array $context = [])
Output the specified view.