<?= dmstr\widgets\Menu::widget(
[
'options' => ['class' => 'sidebar-menu tree', 'data-widget'=> 'tree'],
'items' => [
['label' => 'Меню', 'options' => ['class' => 'header']],
['label' => 'На сайт', 'url' => [Yii::$app->frontUrlManager->createAbsoluteUrl('/site/index')], 'style' => 'target=_blank'],
],
]
);
?>
'frontUrlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'enableStrictParsing' => true,
'showScriptName' => false,
'baseUrl' => '',
//...
],
public function changePassword()
{
if ($this->validate()) {
$user = $this->_user;
$user->setPassword($this->newPassword);
return $user->save();
} else {
return false;
}
}