PHP code example of zf-hipsters / abstract-factory

1. Go to this page and download the library: Download zf-hipsters/abstract-factory library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zf-hipsters / abstract-factory example snippets


"zf-hipsters/abstract-factory": ">=0.9"

php ./composer.phar update

'controllers' => array(
    'invokables' => array(
        'Album\Controller\Album' => 'Album\Controller\AlbumController',
    ),
),


'router' => array(
        'routes' => array(
            'home' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/',
                    'defaults' => array(
                        'controller'    => 'Application\Controller\IndexController',
                        'action'     => 'index',
                    ),
                ),
            ),
        )
);

'smurf' => array(
    'type' => 'Zend\Mvc\Router\Http\Segment',
    'options' => array(
        'route'    => '/smurf[/:action]',
        'controller' => 'Application\Controller\SmurfController',
        'defaults' => array(
            'action' => 'index',
        ),
    ),
),


$this->getServiceLocator()->get('Application\Service\MyService');

$this->getServiceLocator()->get('Application\Service\MyServiceFactory');