'on beforeAction' => function($event){
Yii::$app->controller->attachBehavior('',[
'class' => \yii\filters\AccessControl::className(),
'except' => ['login','error','index'],
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
]);
},
$before = Blog::find()->select( 'id, title, image' )->where( [ '<', ' id', $this->id] )->orderBy('id DESC')->one();
$after = Blog::find()->select( 'id, title, image' )->where( [ '>', ' id', $this->id] )->orderBy('id ASC')->one();
$shema = Yii::$app->db->getTableSchema('some_my_table_name');
/* @var $schema yii\db\TableSchema */
/* @var $column yii\db\ColumnSchema */
$columns = $schema->columns;
print_r($columns);
public $js = [
'js/defina.min.js' => ['data-pace-options'=>'{ "target": ".content-wrap", "ghostTime": 1000 }']
];
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/site.css',
];
public $js = [
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
Call to undefined function mb_strlen()
Как при нажатие на ссылку оставать на той же странице на сайте?
->where(['like', 'name_file', $search])->andWhere(['like', 'type', $search]);
$data = ArrayHelper::toArray(User::find()->all(), [
'app\models\User' => [
'id',
'names' => function ($model) {
return $model->firstName . ' ' . $model->lastName;
},
],
]);
ArrayHelper::map($data, 'id', 'names');
public function getFullName(){
return $this->firstName . ' ' . $this->lastName;
}
ArrayHelper::map(User::find()->all(), 'id', 'fullName');