#Получить из базы
Yii::$app->params['adminEmail'] = "полученный email";
$config = [
#другие конфиги
'bootstrap' => ['log' /*По умолчанию в Yii подключен */, function () {
$adminEmail = (new Query())->select(["email"])->from("config")->where([/*условие*/])->scalar();
Yii::$app->params['adminEmail'] = $adminEmail;
}],
#другие конфиги
];
\Yii::$app->security->generateRandomString($length);
$product->$key = "Что то";
//Получить "Что то"
echo $product->$key;
//Или
echo $product->size;
SELECT *
FROM news n
INNER JOIN news_comments nc ON n.news_id = nc.news_id
GROUP BY n.news_id
ORDER BY COUNT(nc.comment_id) DESC, n.date DESC
News::find()->where(['news.visibility'=>1])
->innerJoin(['nc' => NewsComments::tableName()], 'nc.news_id = news.id')
->groupBy('news.id')
->orderBy('COUNT(nc.id) DESC, news.date DESC');
public function beforeAction($action)
{
if(\Yii::$app->request->isAjax){
\Yii::$app->response->format = Response::FORMAT_JSON;
}
return parent::beforeAction($action);
}
echo $form->field($model, 'number_area_stand[]')->dropDownList($items, $params);
$result = Customer::getDb()->cache(function ($db) {
return Customer::find()->where(['id' => 1])->one();
});
$ids = Users::find(["baned" => $no ])->select("id")->asArray()->column()
"psr-4": { "vkolya\\poll\\": "" }