?

Log in

No account? Create an account

[icon]
View:Свежие записи.
View:Архив.
View:Друзья.
View:Личная информация.
You're looking at the latest 11 entries.

Tags:, , , , ,
Security:
Subject:Верхний пост. Таймкоды видео
Time:18:56
Запуск тестов c виртуальной машины - 1 - 2:57:00
comments: Оставить комментарий

Tags:,
Security:
Subject:Установка AdminLTE
Time:19:43
AdminLTE: Github

Скопировать из vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app/ все содержимое в backend/views/

backend/views/layouts/main.php

<?php

use yii\helpers\Html;

/* @var $this \yii\web\View */
/* @var $content string */


backend\assets\AppAsset::register($this);
dmstr\web\AdminLteAsset::register($this);

$directoryAsset = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist');
?>


и убрать вконце:

<?php } ?>


backend/controllers/SiteController.php

/**
* Login action.
*
* @return string
*/
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}

$this->layout = 'main-login';

$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
return $this->render('login', [
'model' => $model,
]);
}
}
comments: Оставить комментарий

Tags:,
Security:
Subject:.htaccess для advanced-приложения
Time:19:13
.htaccessСвернуть )

Взято с сайта: https://xn--d1acnqm.xn--j1amh/%D0%B7%D0%B0%D0%BF%D0%B8%D1%81%D0%B8/htaccess-%D0%B4%D0%BB%D1%8F-yii-2-advanced
comments: Оставить комментарий

Tags:, ,
Security:
Subject:Единый файловый кеш в common
Time:18:24
common/config/main.php

    'components' => [
'cache' => [
// 'class' => 'yii\caching\MemCache',
// 'useMemcached' => true,
'class' => 'yii\caching\FileCache',
'cachePath' => '@common/runtime/cache',
],
],
comments: Оставить комментарий

Tags:,
Security:
Subject:Единая точка аутентификации
Time:18:20
enviroments/index.php

        'setCookieValidationKey' => [
// 'backend/config/main-local.php',
// 'frontend/config/main-local.php',
'common/config/params-local.php',
],


common/config/params.php

return [
'adminEmail' => 'admin@example.com',
'supportEmail' => 'support@example.com',
'user.passwordResetTokenExpire' => 3600,
'cookieDomain' => '.example.com',
];


common/config/params-local.php

<?php
return [
'cookieValidationKey' => '01_6nxch9QgYzl_LD2nwPmya9zBc6Vfq',
'cookieDomain' => '.mktel-shop.local',
];


backend/config/main.php

    'components' => [
'request' => [
'baseUrl' => '/admin',
'csrfParam' => '_csrf-backend',
'cookieValidationKey' => $params['cookieValidationKey'],
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
// 'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
'identityCookie' => [
'name' => '_identity',
'httpOnly' => true,
'domain' => $params['cookieDomain']
],
],
'session' => [
// this is the name of the session cookie used for login on the backend
// 'name' => 'advanced-backend',
'name' => 'advanced',
'cookieParams' => [
'domain' => $params['cookieDomain'],
'httpOnly' => true,
],
],


frontend/config/main.php

    'components' => [
'request' => [
'baseUrl' => '',
'csrfParam' => '_csrf-frontend',
'cookieValidationKey' => $params['cookieValidationLKey'],
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
// 'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
'identityCookie' => [
'name' => '_identity',
'httpOnly' => true,
'domain' => $params['cookieDomain']
],
],
'session' => [
// this is the name of the session cookie used for login on the frontend
// 'name' => 'advanced-frontend',
'name' => 'advanced',
'cookieParams' => [
'domain' => $params['cookieDomain'],
'httpOnly' => true,
],
],
comments: Оставить комментарий

Tags:,
Security:
Subject:MemCache
Time:18:51
common/config/main.php

Заменить:

'components' => [
'cache' => [
'class' => 'yii\caching\MemCache',
'useMemcached' => true,
],
],
comments: Оставить комментарий

Tags:,
Security:
Subject:Сквозные ссылки
Time:18:17
backend/config/main.php

Добавить:

'backendUrlManager' => require __DIR__.'/urlManager.php',
'frontendUrlManager' => require __DIR__ .'/../../frontend/config/urlManager.php',
'urlManager' => function () {
return Yii::$app->get('backendUrlManager');

},


frontend/config/main.php

Добавить:

'frontendUrlManager' => require __DIR__.'/urlManager.php',
'backendUrlManager' => require __DIR__ .'/../../backend/config/urlManager.php',
'urlManager' => function () {
return Yii::$app->get('frontendUrlManager');

},


urlManager.php

Добавить

'class' => 'yii\web\UrlManager',
comments: Оставить комментарий

Tags:,
Security:
Subject:AccessControl для модуля
Time:17:33
backend/controllers/SiteController.php

Убрать:

'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['login', 'error'],
'allow' => true,
],
[
'actions' => ['logout', 'index'],
'allow' => true,
'roles' => ['@'],
],
],
],


backend/config/main.php

Добавить:

'as access' => [
'class' => 'yii\filters\AccessControl',
'except' => ['site/login', 'site/error'],
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],


'except' - исключение
'only' - только для
comments: Оставить комментарий

Tags:, ,
Security:
Subject:urlManager
Time:17:21
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'' => 'site/index',
'<_a:login|logout>' => 'site/<_a>',
'<_c:[\w\-]+>' => '<_c>/index',
'<_c:[\w\-]+>/<id:\d+>' => '<_c>/view',
'<_c:[\w\-]+>/<_a:[\w\-]+>' => '<_c>/<_a>',
'<_c:[\w\-]+>/<id:\d+>/<_a:[\w\-]+>' => '<_c>/<_a>'
],
],
comments: Оставить комментарий

Tags:, ,
Security:
Subject:Переход на asset-packagist
Time:01:28
composer.json

Добавить

"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],


Удалить

"fxp-asset":{
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}


common/config/main.php

Добавить

'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
comments: Оставить комментарий

Tags:, , ,
Security:
Subject:Настройка папок в PHPStorm
Time:01:02
Settings / Directories
Test Source:

  • backend/tests

  • common/tests

  • frontend/tests


Source:

  • backend

  • common

  • console

  • frontend

Excluded:

  • .vagrant

  • backend/runtime

  • backend/web/assets

  • console/runtime

  • frontend/runtime

  • frontend/web/assets

  • vagrant

  • vendor



Settings / L & F / Composer

Path to composer.json: [path]
[check] Add packages as libraries

Settings / L & F / PHP / Test Frameworks

Codeception Local
Path to Codeception executable: [ \vendor\codeception\base\codecept ]
[check] Default configuration file: [ \codeception.yml ]
comments: Оставить комментарий

[icon]
View:Свежие записи.
View:Архив.
View:Друзья.
View:Личная информация.
You're looking at the latest 11 entries.