<?php /**/ use app\components\HelloWidget; echo HelloWidget::widget(['message' => ' Yii2.0']);
<?php use app\components\HelloWidget; // comment out the following two lines when deployed to production defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_ENV') or define('YII_ENV', 'dev'); require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php'; $config = (require __DIR__ . '/../config/web.php'); (new yii\web\Application($config))->run(); echo HelloWidget::widget();
<?php use app\components\HelloWidget; echo HelloWidget::widget(['name' => 'polje', 'value' => 'Azra']); ?>
<?php echo \app\components\HelloWidget::widget(['message' => 'Good morning']); ?> learn yii2 learn yii2 learn yii2 learn yii2 learn yii2 learn yii2 learn yii2
?> </li> </ul> </div> </nav> </div> <div class="col-xs-4"> <button aria-controls="navbar" class="menu-link dspl" type="button"> <?php echo Html::img(Yii::$app->request->baseUrl . '/images/flag.jpg', ['class' => '', 'alt' => 'Flag Image']); ?> </button> <div class="dspl-hidn navbarTop" id="navbar navigation"> <?php $country = HelloWidget::widget(); $countryList = json_decode($country, true); ?> <ul class="nav flags"> <?php $ListCount = 1; $listArray = array(); foreach ($countryList as $listCountry) { if ($ListCount <= 4) { ?> <li> <?php echo Html::a(Html::img(Yii::getAlias('@BackendEndUrl') . '/img/flags/' . $listCountry['countries_code'] . '.png', ['class' => '', 'alt' => $listCountry['countries']['name'], 'title' => $listCountry['countries']['name']]), Yii::$app->homeUrl); ?> </li> <?php
$this->beginBlock('block1'); ?> <div> ...content of block1... </div> <?php $this->endBlock(); ?> <?php echo $this->blocks['block1']; ?> <?php echo HelloWidget::widget(['message' => 'Good morning']); ?> <br> path of @foo is <?php echo Yii::getAlias('@foo'); ?> <br> path of @app is <?php echo Yii::getAlias('@app'); ?> <br> path of @web is <?php echo Yii::getAlias('@web'); ?> <br>