andrebian/zf3-service-manager-trait

A fast way to get the Zend Framework 3's service manager in controllers

dev-master 2019-04-29 23:55 UTC

This package is auto-updated.

Last update: 2024-03-29 03:51:37 UTC


README

A fast way to get the Zend Framework 3's service manager in controllers

Install

composer require andrebian/zf3-service-manager-trait

Usage

In a controller

<?php 

namespace YourNamespace;

use ServiceManagerTrait\ServiceManagerTrait;

/**
* Class YourController
 * @package YourNamespace
 */
class YourController extends AbstractActionController
{
    use ServiceManagerTrait;
    
    public function someAction()
    {
        $serviceManager = $this->getServiceManager();
    }
}

Contributions

You can open an issue or fork this repository, modify whatever you want and send a Pull Request.