public function testdisplay() { $view = new ViewHtml(); //execute the method and test if it works and does not throws an exception. try { $view->display(); } catch (Exception $e) { $this->fail(); } }
function CustomViewMakeDefaultBackup() { parent::ViewHtml(); }
<?php use yii\helpers\Html; use yii\widgets\DetailView; /* @var $this yii\web\View */ /* @var $model backend\models\Virtual */ $this->title = $model->name; $this->params['breadcrumbs'][] = ['label' => 'Virtuals', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="virtual-view"> <h4><?php echo ViewHtml::encode($this->title); ?> </h4> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'name', 'description']]); ?> </div>