コード例 #1
0
ファイル: show.php プロジェクト: Sywooch/RabotaNURE
<?php

/* @var $this yii\web\View */
/* @var $model app\models\Page */
use yii\helpers\Html;
use app\models\Image;
?>

<h2><?php 
echo $model->title;
?>
</h2>
<h2><?php 
echo $model->text;
?>
</h2>
<h2><?php 
echo Html::img(Image::getImagePath($model->getImage()->one()));
?>
</h2>
コード例 #2
0
ファイル: view.php プロジェクト: Sywooch/RabotaNURE
use yii\helpers\Html;
use yii\widgets\DetailView;
use app\models\Image;
/* @var $this yii\web\View */
/* @var $model app\models\Page */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Pages', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="page-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('Delete', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'name', 'title', 'text:ntext', 'lang', ['attribute' => 'image_id', 'value' => Image::getImagePath($model->getImage()->one()), 'format' => ['image', ['width' => '100', 'height' => '100']]]]]);
?>

</div>