PHP Classes

File: src/Factory/Zf3ControllerFactory.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu   Jaxon for Zend Framework   src/Factory/Zf3ControllerFactory.php   Download  
File: src/Factory/Zf3ControllerFactory.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon for Zend Framework
Zend plugin to call PHP classes from with AJAX
Author: By
Last change: Added a gateway to the DI container.
Date: 3 years ago
Size: 708 bytes
 

Contents

Class file image Download
<?php

namespace Jaxon\Zend\Factory;

use
Interop\Container\ContainerInterface;
use
Zend\ServiceManager\Factory\FactoryInterface;

class
Zf3ControllerFactory implements FactoryInterface
{
   
/**
     * Create a Jaxon Controller
     *
     * @param ServiceLocatorInterface $serviceLocator
     *
     * @return mixed
     */
   
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
       
// Get and configure the Jaxon plugin
       
$jaxonPlugin = $container->get('JaxonPlugin');
       
$jaxonPlugin->setContainer($container);
       
// Create the Controller, passing the JaxonPlugin as parameter
       
return new $requestedName($jaxonPlugin);
    }
}