Answer the question
In order to leave comments, you need to log in
I can not find a strange error, broke my whole head?
Help me find the error, I broke my whole head
when opening it /post/default/view
gives
Not Found
The requested URL /post.txt/default/view was not found on this server.
All other routes work fine, the problem is in the post
. What is post.txt?
There is only one rule in urlManager
'<_m:[\w\-]+>/<_c:[\w\-]+>/<_a:[\w\-]+>' => '<_m>/<_c>/<_a>',
Answer the question
In order to leave comments, you need to log in
Here is the view
<?php
use yii\helpers\Html;
use yii\helpers\HtmlPurifier;
$this->title = Yii::$app->name . ' / ' . $model->title;
$this->params['breadcrumbs'][] = ['label' => Yii::t('main', 'News'), 'url' => ['/post/default/index']];
$this->params['breadcrumbs'][] = ['label' => $model->parent->title, 'url' => ['/post/default/category', 'slug' => $model->parent->slug]];
$this->params['breadcrumbs'][] = $model->title;
$this->registerMetaTag(['name' => 'description', 'content' => $model->description]);
$this->registerMetaTag(['name' => 'keywords', 'content' => $model->keywords]);
?>
<div class="col-md-6">
<div class="well">
<div class="page-title"><h1><?= Yii::t('main', 'News') ?></h1></div>
<div class="box88">
<h1 class="title"><?= Html::encode($model->title) ?></h1>
<div class="pad10">
<?= Html::img($model->picUrl, ['class' => 'img-responsive']); ?>
</div>
<div class="pad10">
<?= HtmlPurifier::process($model->short); ?>
</div>
<div class="clear"></div>
...
<div class="pad5">
<?= HtmlPurifier::process($model->full); ?>
</div>
<div class="clear"></div>
<?php if (!empty($model->tagLinks)) : ?>
<div class="tags">
<b><?= Yii::t('main', 'Tags') ?></b>:
<?= $model->tagLinks ?>
</div>
<?php endif; ?>
<div class="author_panel">
<p><i class="fa fa-user-secret"></i> <?= $model->user->username ?> <i
class="fa fa-calendar-check-o"></i> <?= Yii::$app->formatter->asDate($model->created_at) ?></p>
</div>
<br/>
<?= \app\modules\comments\widgets\CommentWidget::widget(['model' => $model]) ?>
</div>
</div>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question