class Application (View source)

Methods

__construct(Request $request, Response $response)

Application constructor

getContainer()

Get container

getRouter()

Get router

bool
isRunningOnCli()

Check if it is running on php cli

bool
run()

Launcher of the application

void
disablePoweredByMention()

Allows you to enable writing the X-Powered-By header in the answer of the inquiry.

rest(string $url, string|array $controller_name, array $where = [])

Make the REST API base on route and resource controller.

static Application
make(Request $request, Response $response)

Build the application

void
abort(int $code = 500, string $message = '', array $headers = [])

Abort application

mixed
container(string|null $name = null, callable|null $callable = null)

Build dependence

void
bind(Loader $config)

Configuration Association

mixed
__invoke(array ...$params)

__invoke

void
send()

Send the application response

mixed
__call(string $method, array $args)

Delegate method calls to the router

Details

__construct(Request $request, Response $response)

Application constructor

Parameters

Request $request
Response $response

Exceptions

BadRequestException

Capsule getContainer()

Get container

Return Value

Capsule

Router getRouter()

Get router

Return Value

Router

bool isRunningOnCli()

Check if it is running on php cli

Return Value

bool

bool run()

Launcher of the application

Return Value

bool

Exceptions

ReflectionException
RouterException

void disablePoweredByMention()

Allows you to enable writing the X-Powered-By header in the answer of the inquiry.

Return Value

void

Application rest(string $url, string|array $controller_name, array $where = [])

Make the REST API base on route and resource controller.

Parameters

string $url
string|array $controller_name
array $where

Return Value

Application

Exceptions

ApplicationException

static Application make(Request $request, Response $response)

Build the application

Parameters

Request $request
Response $response

Return Value

Application

Exceptions

BadRequestException

void abort(int $code = 500, string $message = '', array $headers = [])

Abort application

Parameters

int $code
string $message
array $headers

Return Value

void

Exceptions

HttpException

mixed container(string|null $name = null, callable|null $callable = null)

Build dependence

Parameters

string|null $name
callable|null $callable

Return Value

mixed

Exceptions

ApplicationException

void bind(Loader $config)

Configuration Association

Parameters

Loader $config

Return Value

void

mixed __invoke(array ...$params)

__invoke

This point method on the container system

Parameters

array ...$params

Return Value

mixed

Exceptions

ApplicationException

void send()

Send the application response

Return Value

void

mixed __call(string $method, array $args)

Delegate method calls to the router

Parameters

string $method
array $args

Return Value

mixed

Exceptions

ApplicationException