<?php use app\components\FirstWidget; use app\components\SecondWidget; use yii\bootstrap\Modal; /* @var $this yii\web\View * @var $hello string */ $this->registerCssFile('@web/css/main.css'); $this->registerJsFile('@web/js/main-index.js', ['position' => \yii\web\View::POS_END], 'main-index'); $this->registerCss("body {background: #fff;}"); ?> <h3>main/index</h3> <h1><?php echo $hello; ?> </h1> <?php echo FirstWidget::widget(['a' => 5, 'b' => 7]); SecondWidget::begin(); ?> Красный текст <?php SecondWidget::end();
use app\components\FirstWidget; use app\components\SecondWidget; use yii\bootstrap\Modal; use yii\jui\DatePicker; use yii\bootstrap\Nav; ?> <div class="test-default-index"> <h1>Панель управления.</h1> <?php echo Nav::widget(['items' => [['label' => 'Ссылка1', 'url' => ['#']], ['label' => 'Ссылка2', 'url' => ['#']], ['label' => 'Выпадающий список', 'items' => [['label' => 'Ссылка1', 'url' => ['#']], '<li class="divider"></li>', '<li class="dropdown-header">Описание</li>', ['label' => 'Ссылка2', 'url' => ['#']]]]]]); ?> <?php echo FirstWidget::widget(['a' => 33, 'b' => 67]); ?> <?php SecondWidget::begin(); ?> Этот текст сделаем красным. <?php SecondWidget::end(); ?> <?php Modal::begin(['header' => '<h2>Привет МИР !!!</h2>', 'toggleButton' => ['label' => 'нажми']]); echo 'это контент модального окна...'; Modal::end(); ?>
/* @var $this yii\web\View */ //$this->registerJsFile('@web/js/main-index.js', [ 'position'=>\yii\web\View::POS_HEAD ], 'main-index'); //$this->registerJs('console.log("YEPPY!")', $this::POS_LOAD, 'console msg'); // //$this->registerCssFile('@web/css/main.css',[], 'main.css'); //$this->registerCss('body{ background: #0ff; }'); ?> <h1>main/index</h1> <p> <?php echo $hello; ?> </p> <?php echo FirstWidget::widget(['a' => 15, 'b' => 113]); ?> <?php echo DatePicker::widget(['attribute' => 'from_date']); ?> <?php SecondWidget::begin(); ?> Цей тест зробимо синім. <?php SecondWidget::end(); ?>