Skip to content

jon-acker/magento-symfony-container

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magento-symfony-container

Provides Magento with an instance of a Symfony DI Container

Usage in Controller

class Inviqa_Zygourator_IndexController extends Inviqa_SymfonyContainer_Controller_Base
{
    public function indexAction()
    {
        $this->_controller->get('acme.mailer')->send();
        
        $this->loadLayout();
        $this->renderLayout();
    }
}

Usage in Observer

class Inviqa_Zygourator_Model_Observer extends Inviqa_SymfonyContainer_Model_Observer
{
    public function productSaved()
    {
        $this->_controller->get('acme.mailer')->send();
    }
}

Access to container anywhere else

$container = Mage::getSingleton'inviqa_symfonyContainer/config')->getContainer();

About

Provides Magento with an instance of a Symfony DI Container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%