Skip to content

Dependency Injection Container (PSR-11)

Updated View as Markdown

Overview

Phalcon\Container is an implementation of the PSR-11 Container interface as defined by PHP-FIG.

This component aids with receiving and setting services in the DI container

Activation

To set the container up, you first need to have a Phalcon\Di object already set up.

<?php

use Phalcon\Di\FactoryDefault;
use Phalcon\Container;

$default   = new FactoryDefault();
$container = new Container($default);

$request = $container->get('request');
Navigation

Type to search…

↑↓ navigate↵ selectEsc close