<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
issei-m / sf-dependency-injection-plugin example snippets
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins('sfDependencyInjectionPlugin');
...
}
}
// Get the ServiceContainer.
$container = sfContext::getInstance()->getContainer();
// Retrieve the NewsletterManager class which was initialized with the Mailer.
$newsletterManager = $container->get('newsletter_manager');