class db {
private $config;
public function __construct(Config $config)
{
$this->config = $config;
$this->connect();
}
private function connect()
{
$host = $this->config->host;
...
}
}
'sort' => [
'class' => SortableGridBehavior::className(),
'sortableAttribute' => 'position',
'scope' => function ($query) {
$query->andWhere(['tour_id' => ':tour'], [':tour' => Yii::$app->request->get('id')]);
},
],