Answer the question
In order to leave comments, you need to log in
The site opens in the middle of the page, how to fix it?
Hello everybody! The essence of the problem is that there is a website, which in some way resembles a landing page in structure, the main page consists of several blocks. The first three blocks I have come with static information, but in the fourth block there is a contact form and the procedure for its actions is described in my index action in SiteController. Now, when opening, the site opens not from the first block, but from the block with the contact form. How can I fix this please?
public function actionIndex()
{
$model = new ContactForm();
if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->save() && $model->contact(Yii::$app->params['adminEmail']) && $_POST["ContactForm"]["check"] === 'nospam'){
Yii::$app->session->setFlash('success', "Ваше сообщение отправлено! Спасибо за обращение!");
return $this->refresh();
}
return $this->render('index', [
'model' => $model,
]);
}
Answer the question
In order to leave comments, you need to log in
It's hard to say here, the form processing code is like the norms, the variant:
Were the static blocks in the main template protected or pulled up by nested templates? If templates, then they were not damaged in any way?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question