<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-frontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'frontend\controllers',
    'components' => [
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'request'=>[
	        'class' => 'common\components\Request',
	        'web'=> '/frontend/web'
        ],
        'urlManager' => [
	        'enablePrettyUrl' => true,
	        'showScriptName' => false,
	        'rules' => [
		        'vacancies' => 'site/vacancies',
		        'contact' => 'site/contact',
		        'team' => 'site/team',
		        'team/<id:\d+>' => 'site/team',
		        'login' => 'site/login',
		        'logout' => 'site/logout',
		        'services/<name:\w+>' => 'site/serviceitem',
		        'count_form' => 'site/count_form',
		        'orders/audit' => 'site/auditform',
		        'orders/audit/<result:\w+>' => 'site/auditform',
	        ]
        ],
    ],
    'params' => $params,
];
