Exemplo n.º 1
0
<?php

/**/
use app\components\HelloWidget;
echo HelloWidget::widget(['message' => ' Yii2.0']);
Exemplo n.º 2
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();
Exemplo n.º 3
0
<?php

use app\components\HelloWidget;
echo HelloWidget::widget(['name' => 'polje', 'value' => 'Azra']);
?>

Exemplo n.º 4
0
<?php

echo \app\components\HelloWidget::widget(['message' => 'Good morning']);
?>
learn yii2 learn yii2 learn yii2 learn yii2 learn yii2 learn yii2 learn yii2

Exemplo n.º 5
0
?>
</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 
Exemplo n.º 6
0
$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>