<?php

namespace Activity;

use Zend\Router\Http\Segment;
use Zend\ServiceManager\Factory\InvokableFactory;

//$cityModule = new \Zend\Session\Container('cityModule');
//$cityName = isset($cityModule->city_name) ? $cityModule->city_name : '';

return [
    'router' => [
        'routes' => [
            'local-hire' => [
                'type' => Segment::class,
                'options' => [
                    'route' => '/activity[/:action][/:param]',
                    'defaults' => [
                        'controller' => Controller\IndexController::class,
                        'action' => 'index',
                    ],
                    'constraints' => [
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'param' => '[a-zA-Z0-9]*',
                        'city' => '[a-zA-Z0-9]*'
                    ],
                ],
            ],
        ],
    ],
    'controllers' => [
        'factories' => [
            Controller\IndexController::class => InvokableFactory::class,
        ],
    ],
    'view_manager' => [
        'display_not_found_reason' => true,
        'display_exceptions' => true,
        'doctype' => 'HTML5',
        'not_found_template' => 'error/404',
        'exception_template' => 'error/index',
        'template_map' => [
            //'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
            'activity/index/index' => __DIR__ . '/../view/activity/index/index.phtml',
            'error/404' => __DIR__ . '/../view/404.phtml',
            'error/index' => __DIR__ . '/../view/error/index.phtml',
        ],
        'template_path_stack' => [
            __DIR__ . '/../view',
        ],
        'strategies' => [
            'ViewJsonStrategy',
        ],
    ],
    'moduleLayouts' => [
        'Activity' => 'layout/activity.phtml'
    ],
];
