<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fpeters / sf-dependency-injection-plugin example snippets
// in a action.class
$container = $this->getServiceContainer();
$container->get('myCoolService');
// there is a short version of that
$this->getService('myCoolService');
php
// Load Services from services.yml
$this->dispatcher->connect(
'service_container.load_configuration',
function (sfEvent $event) {
// load global config dir
$loader = new YamlFileLoader($event->getSubject(), new FileLocator(sfConfig::get('sf_config_dir')));
$loader->load('services.yml');
}
);
$this->dispatcher->connect(
'service_container.loaded',
function (sfEvent $event) {
// here you can do stuff when container is loaded
$service = $event->getSubject()->get('myCoolService');
}
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.