Changed all calls to View::render() in views to use absolute path within module

Maximises compatibility with view overrides, preventing "View not Found – yii\base\ViewNotFoundException" errors when a view is overridden that contains a call to `View::render()` and a relative path was specified
This commit is contained in:
Alec Pritchard
2018-05-01 12:17:43 +01:00
parent bc438974f0
commit a604abb018
13 changed files with 13 additions and 13 deletions

View File

@ -32,7 +32,7 @@ use yii\helpers\Html;
] ]
); ?> ); ?>
<?= $this->render('_user', ['form' => $form, 'user' => $user]) ?> <?= $this->render('/admin/_user', ['form' => $form, 'user' => $user]) ?>
<div class="form-group"> <div class="form-group">
<div class="col-lg-offset-3 col-lg-9"> <div class="col-lg-offset-3 col-lg-9">

View File

@ -96,7 +96,7 @@ $this->params['breadcrumbs'][] = $this->title;
] ]
); ?> ); ?>
<?= $this->render('_user', ['form' => $form, 'user' => $user]) ?> <?= $this->render('/admin/_user', ['form' => $form, 'user' => $user]) ?>
<div class="form-group"> <div class="form-group">
<div class="col-lg-offset-3 col-lg-9"> <div class="col-lg-offset-3 col-lg-9">

View File

@ -23,7 +23,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?> <?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
<?= $this->render( <?= $this->render(
'_form', '/permission/_form',
[ [
'model' => $model, 'model' => $model,
'unassignedItems' => $unassignedItems, 'unassignedItems' => $unassignedItems,

View File

@ -23,7 +23,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?> <?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
<?= $this->render( <?= $this->render(
'_form', '/permission/_form',
[ [
'model' => $model, 'model' => $model,
'unassignedItems' => $unassignedItems, 'unassignedItems' => $unassignedItems,

View File

@ -22,7 +22,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?> <?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
<?= $this->render( <?= $this->render(
'_form', '/role/_form',
[ [
'model' => $model, 'model' => $model,
'unassignedItems' => $unassignedItems, 'unassignedItems' => $unassignedItems,

View File

@ -22,7 +22,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?> <?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
<?= $this->render( <?= $this->render(
'_form', '/role/_form',
[ [
'model' => $model, 'model' => $model,
'unassignedItems' => $unassignedItems, 'unassignedItems' => $unassignedItems,

View File

@ -22,7 +22,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?> <?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
<?= $this->render( <?= $this->render(
'_form', '/rule/_form',
[ [
'model' => $model, 'model' => $model,
] ]

View File

@ -23,7 +23,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?> <?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
<?= $this->render( <?= $this->render(
'_form', '/rule/_form',
[ [
'model' => $model, 'model' => $model,
] ]

View File

@ -31,7 +31,7 @@ $module = Yii::$app->getModule('user');
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<?= $this->render('_menu') ?> <?= $this->render('/settings/_menu') ?>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
<div class="panel panel-default"> <div class="panel panel-default">

View File

@ -28,7 +28,7 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<?= $this->render('_menu') ?> <?= $this->render('/networks/_menu') ?>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
<div class="panel panel-default"> <div class="panel panel-default">

View File

@ -32,7 +32,7 @@ $timezoneHelper = $model->make(TimezoneHelper::class);
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<?= $this->render('_menu') ?> <?= $this->render('/profile/_menu') ?>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
<div class="panel panel-default"> <div class="panel panel-default">

View File

@ -32,7 +32,7 @@ use yii\helpers\Html;
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3> <h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<?= $this->render('_menu') ?> <?= $this->render('/shared/_menu') ?>
<?= $content ?> <?= $content ?>
</div> </div>
</div> </div>

View File

@ -20,7 +20,7 @@ $this->title = $title;
?> ?>
<?= $this->render( <?= $this->render(
'_alert', '/shared/_alert',
[ [
'module' => $module, 'module' => $module,
] ]