PHP code example of sebaks / zend-mvc-controller

1. Go to this page and download the library: Download sebaks/zend-mvc-controller 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/ */

    

sebaks / zend-mvc-controller example snippets


'router' => [
    'routes' => [
        'user-update-profile' => [
            'type' => 'Segment',
            'options' => [
                'route'    => '/profile/update',
                'defaults' => [
                    'controller' => 'sebaks-zend-mvc-controller',
                    'allowedMethods' => ['POST'],
                    'criteriaValidator' => Users\Action\Profile\CriteriaValidator::class,
                    'changesValidator' => Users\Action\Profile\ChangesValidator::class,
                    'service' => Users\Action\Profile\Updater::class,
                    'request' => Sebaks\Controller\RequestInterface::class,
                    'routeCriteria' => 'id'
                    'response' => Sebaks\Controller\ResponseInterface::class,
                    'redirectTo' => 'admin-user-list',
                    'viewModel' => Users\User\ViewModel::class,
                ],
            ],
        ],
    ],
],