public function answerCallbackQuery($callbackQueryId, $text = null, $showAlert = false)
{
return $this->call('answerCallbackQuery', [
'callback_query_id' => $callbackQueryId,
'text' => $text,
'show_alert' => (bool)$showAlert,
]);
}
move_uploaded_file($this->request->files['file']['tmp_name'], '/var/www/user/data/www/site/download/' . $file);
Forbidden
You don't have permission to access /system/storage/download/price.xlsx on this server.
<a href="путь для файла">Прайс-лист</a>
$model->contact(Yii::$app->params['adminEmail'])
public function contact(какие то данные)
{
$user->tel = Html::encode($form->tel);
$user->skype = Html::encode($form->skype);
$user->whatsapp = Html::encode($form->whatsapp);
$user->index = Html::encode($form->index);
$user->save();
}
$id = Yii::$app->user->identity->id;
$user = ContactForm::find()->where(['user_id' => $id])->one();
$form = new ContactForm($user);
if ($form->load(Yii::$app->request->post()) && $form->validate() && $form->save()) {
return $this->refresh();
}else{
return $this->render('profile', compact('form', 'user'));
}
Integrity constraint violation
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'
The SQL being executed was: INSERT INTO `contact` (`id`, `user_id`, `tel`, `skype`, `whatsapp`, `index`) VALUES (1, 1, '123123', 'qweqweqwe', '123123', '')
Class 'app\modules\dashboard\models\dektrium\user\models\User' not found
PHP Warning – yii\base\ErrorException
Invalid argument supplied for foreach()