- код темы копирую в папку themes/views/layouts/,
themes/name_theme/layouts -> шаблон темы (main.php), с меню, шапкой и подвалом.
themes/name_theme/site -> виды темы
themes/name_theme/assets -> ресурсы (css, js и т.д.)public $sourcePath = '@app/themes/portfolio/assets';use app\assets\MyTheme;
MyTheme::register($this);'view' => [
'theme' => [
'basePath' => '@app/themes/name_theme',
'baseUrl' => '@web/themes/name_theme',
'pathMap' => [
'@app/views' => '@app/themes/name_theme'
]
]
],
public function actionFirst()
{
$session = Yii::$app->session;
/* выполняете какие-то проверки и заносите данные в сессию */
if(*****){
$session->set('name', $this->name);
}
}
public function actionSecond()
{
$session = Yii::$app->session;
return $session->get('name');
}
echo "errornumber";
'pathMap' => [
'@app/modules' => '@app/themes/basic/modules', // <-- !!!
],public $sourcePath = '@app/themes/basic/modules';
public function validatePassword()
{
if (!$this->hasErrors()) {
$user = $this->getUser();
if (!$user || !$user->validatePassword($this->password)) {
$this->addError('password', 'Неправильный логин или пароль.');
}
}
}
public $select_list;
public function rules()
{
return [
['select_list', 'required'],
['select_list', 'each', 'rule' => ['integer']]
];
}
public static function getValuesArray()
{
return [
'first' => 'first',
'1' => 'second',
'2' => 'third'
];
}<?= $form->field($model, 'select_list')->dropDownList(CheckText::getValuesArray(),['multiple' => true]) ?>
То есть любой дописанный символ в адресной строке выдаёт ошибку 404
Работаю в Linux
'' => 'site/index''showScriptName' => false,