A
A
akula222017-02-19 12:15:20
Yii
akula22, 2017-02-19 12:15:20

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/viewgives
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>',

If I make such a page /post request, I get the output of the
Array array
(
[items] => {"437":439,"439":437}
)
and there should be a Not Found (#404) exception
in the controller, everything is clean! as in the model and in the views
The whole project went through everything clean on die () var_dumps and print_r, did and composer update
even cleaned the base, it still displays this array, where does it come from, how to find it? tell

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
akula22, 2017-02-19
@akula22

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 ?> &nbsp; <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 question

Ask a Question

731 491 924 answers to any question