A
A
Alexander Ivanov2018-02-17 14:31:30
Yii
Alexander Ivanov, 2018-02-17 14:31:30

Why doesn't static page appear in YII2(advanced)?

I started to study yii2 advanced template, before that I tried to work in the basic template.
I add url

<p><a class="btn btn-default" href="<?= Url::to(['DetaliesSkill']) ?>">Ссылка</a></p>

I describe in the controller which is in the frontend folder
public function actionDetaliesSkill()
    {
        
            return $this->render('DetaliesSkill');
        
    }

create page in frontend/view/site/ folder
<?php

/* @var $this yii\web\View */
/* @var $name string */
/* @var $message string */
/* @var $exception Exception */

use yii\helpers\Html;

?>
<div>
Статическая страница
</div>

As a result, Not Found (#404), in the base template it turned out that way.
Perhaps the problem is that the backend folder also has its own controller? What could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-02-17
@alexsteadfast

Good afternoon.
Show, for starters, the rules for urlManager() in the config file and fix it in the link
If you write the name of the action using CamelCase , then you must substitute the name in the url parameters with lowercase letters and separate the dash.
p.s.
same here
return $this->render('DetaliesSkill');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question