Di::getInternalEventsManager

public getInternalEventsManager () Returns the internal event manager

Di::getDefault

public static getDefault () Return the latest DI created

Di::get

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

Di::attempt

public attempt (mixed $name, mixed $definition, [mixed $shared]) Attempts to register a service in the services container Only is successful if a service hasn’t been registered previously with the same name

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

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

Debug\Exception

extends class Phalcon\Exception implements Throwable Source on GitHub Methods final private Exception __clone () inherited from Exception Clone the exception public __construct ([string $message], [int $code], [Exception $previous]) inherited from Exception Exception constructor public __wakeup () inherited from Exception ... final public string getMessage () inherited from Exception Gets the Exception message final public int getCode () inherited from Exception Gets the Exception code fin

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");