D
D
Denis Goncharenko2015-10-26 16:03:09
Phalcon
Denis Goncharenko, 2015-10-26 16:03:09

How to get quick access to phalcon services?

We register a new service:
$di->set('Service', new Service());
In the controller, to use it, you need to create an instance:

$service = new Service();
$service->someMethod();

How to make it so that it can be accessed without creating an instance:
$this->service->someMethod();
For example, as a request component
$this->request->isPost();

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question