Di::getServices

public getServices () Return the services registered in the DI

Di::getInternalEventsManager

public getInternalEventsManager () Returns the internal event manager

Di::getShared

public mixed getShared (string $name, [array $parameters]) Resolves a service, the resolved service is stored in the DI, subsequent requests for this service will return the same instance

Di::get

public get (mixed $name, [mixed $parameters]) Resolves the service based on its configuration

Dependency Injection Explained

The following example is a bit lengthy, but it attempts to explain why Phalcon uses service location and dependency injection. First, let’s pretend we are developing a component called SomeComponent. This performs a task that is not important now. Our component has some dependency that is a connection to a database. In this first example, the connection is created inside the component. This approach is impractical; due to the fact we cannot change the connection parameters or the type of databa

Di

implements Phalcon\DiInterface, ArrayAccess Source on GitHub Phalcon\Di is a component that implements Dependency Injection/Service Location of services and it’s itself a container for them. Since Phalcon is highly decoupled, Phalcon\Di is essential to integrate the different components of the framework. The developer can also use this component to inject dependencies and manage global instances of the different classes used in the application. Basically, this component implements the Inversion

Dependency Injection/Service Location

Before reading this section, it is wise to read the section which explains why Phalcon uses service location and dependency injection. Phalcon\Di is a component implementing Dependency Injection and Location of services and it’s itself a container for them. Since Phalcon is highly decoupled, Phalcon\Di is essential to integrate the different components of the framework. The developer can also use this component to inject dependencies and manage global instances of the different classes used i

Debug\Dump::variables

public variables () Returns an HTML string of debugging information about any number of variables, each wrapped in a “pre” tag. $foo = "string"; $bar = ["key" => "value"]; $baz = new stdClass(); echo (new \Phalcon\Debug\Dump())->variables($foo, $bar, $baz);

Debug\Dump::variable

public variable (mixed $variable, [mixed $name]) Returns an HTML string of information about a single variable. echo (new \Phalcon\Debug\Dump())->variable($foo, "foo");

Debug\Dump::setStyles

public setStyles ([mixed $styles]) Set styles for vars type