$bodySafe = htmlspecialchars($this->body, ENT_QUOTES, "UTF-8");
$db->createCommand('INSERT INTO comments (nick, body)' .
' VALUES (\'' . $nickSafe . '\', REPLACE("' . $bodySafe . '", "\n", "<br />"));')->execute();
return true;
}
return false;
}
$comment = new Comment([
'nick' => Yii::$app->user->identity->email,
'body' => $this->body,
'model' => 'news',
'model_id' => 1234
]);
return $comment->save();
$result = $db->createCommand('INSERT INTO comments (nick, body, model, model_id) VALUES (:nick, :body, :model, :model_id)', [
'nick' => Yii::$app->user->identity->email,
'body' => $this->body,
'model' => 'news',
'model_id' => 1234
])->execute();
return $result;
The variable `{{a}` on line 50 in `calendar_pr/node_modules/balanced-match/README.md` was not properly closed with `}}`.
Переменная `a` в строке 50 файла README.md не была правильно закрыта двумя фигурными скобками
.[['date_notification'], 'date', 'format' => 'php:Y-m-d\TH:m'],
'php:Y-m-d\TH:i'
),[['date_notification'], 'required'],
[['date_notification'], 'default', 'value' => date('Y-m-dTH:i')],
date_notification
и стоит NOT NULL.$rows = Products::find()
->select(['category_id' => 'CAT.id', 'product_id' => 'PROD.id', 'product_price' => 'PROD.price'])
->from(['PROD' => Products::tableName()])
->innerJoin(['CAT' => Categories::tableName()], 'CAT.id = PROD.category_id')
->orderBy(['PROD.price' => SORT_ASC])
->asArray()->all();
$rows = ArrayHelper::index($rows, 'product_id', 'category_id');
[
1 => [
177 => ['category_id' => 1, 'product_id' => 177, 'price' => 1000],
178 => ['category_id' => 1, 'product_id' => 177, 'price' => 2000],
],
2 => [
179 => ['category_id' => 2, 'product_id' => 179, 'price' => 3000],
192 => ['category_id' => 2, 'product_id' => 192, 'price' => 4000],
],
]