'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=my_db',
'username' => 'db_user',
'password' => 'db_password',
// 'enableSchemaCache' => true,
// 'schemaCacheDuration' => 3600,
// 'tablePrefix' => '',
// 'charset' => 'utf8mb4',
// 'enableQueryCache' => true,
// 'queryCacheDuration' => 600,
],
backend && frontend && console
) нужно вынести в main-local.php в папке common
. А все файлы конфигурации настраивать в папке environments
и запускать php init
. `cities`
:id | name
`vilages`
:id | city_id | name
`areas`
:id | vilage_id | coordinates | photo
`persons`
:id | area_id | firstname | lastname | etc...
`city_id`
указывает на таблицу `cities`
, `vilage_id`
на таблицу `vilages`
и т.д. Yii::$app->queue->delay(5 * 60)->push(new MassSendMailJob([
'emails' => Clients::findAll(['notify_me' => true]),
'text' => $text,
]));
application.css
и application.js
должны находится в @webroot/css|@webroot/js
соответственно.@frontend/assets
то и пишите так:<?php
namespace frontend\assets;
use yii\web\AssetBundle;
/**
* Main frontend application asset bundle.
*/
class AppAsset extends AssetBundle
{
public $sourcePath = '@frontend/assets';
public $css = [
'css/application.css',
];
public $js = [
'js/application.js',
];
public $depends = [
'yii\web\YiiAsset',
];
}
@frontend/assets/css/application.css
@frontend/assets/js/application.js