M
M
Michael2019-08-08 22:18:04
Yii
Michael, 2019-08-08 22:18:04

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

2 answer(s)
D
Daria Motorina, 2019-08-08
@glaphire

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?

G
Gip, 2019-08-09
@Giperoglif

it looks like your layout is not drawn, or what?
just the index view?
this, of course, is a two-story tin:
Do you understand what is going on there?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question