andrebian/zf3-service-manager-trait

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

Maintainers

Package info

github.com/andrebian/zf3-service-manager-trait

pkg:composer/andrebian/zf3-service-manager-trait

Statistics

Installs: 579

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

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

This package is auto-updated.

Last update: 2026-03-01 00:27:46 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.