Exemple #1
0
<?php

/* @var $this yii\web\View
 * @var $hello string */
use common\widgets\GoogleMapsMarkers\GoogleMaps;
//use common\widgets\CurrencyConverter\CurrencyConverter;
if (Yii::$app->user->can('Редактор')) {
    Yii::$app->assetManager->forceCopy = true;
}
?>
<div class="container">
<?php 
if (!Yii::$app->user->isGuest) {
    echo '<br>' . Yii::$app->formatter->asDatetime(Yii::$app->user->identity['created_at']);
    echo '<br>' . Yii::$app->timezone->name;
    //Yii::$app->session->remove('timezone');
}
?>
</div>
    <div class="container">
        <?php 
echo GoogleMaps::widget(['googleMapsUrlOptions' => ['language' => Yii::$app->language, 'version' => '3.1.18'], 'googleMapsOptions' => ['mapTypeId' => 'roadmap', 'zoom' => 1]]);
?>
    </div>


Exemple #2
0
<?php

return ['name' => 'setYes', 'language' => 'ru', 'charset' => 'UTF-8', 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'components' => ['userAgentParser' => ['class' => \yii\useragentparser\UserAgentParser::className(), 'nameHttpPropertyUserAgent' => 'HTTP_USER_AGENT'], 'googleApi' => ['class' => \common\widgets\GoogleMapsMarkers\GoogleMaps::className(), 'geocode_api_key' => 'AIzaSyBn0XnEmdPDw9ku7H66JT4_9KN7IXDZfcA', 'webroot' => '@webroot', 'map_language' => 'en'], 'reCaptcha' => ['name' => 'reCaptcha', 'class' => 'himiklab\\yii2\\recaptcha\\ReCaptcha', 'siteKey' => '6LcWAxMTAAAAAD2teUNSJdJ8OwfQuqIUyJJDW79j', 'secret' => '6LcWAxMTAAAAAEZCbXGi-azhHhA8kYRq5WmY9pLg'], 'redis' => ['class' => \yii\redis\Connection::className(), 'hostname' => 'localhost', 'port' => 6379, 'database' => 0, 'dataTimeout' => 30], 'cache' => ['class' => 'yii\\redis\\Cache', 'redis' => ['hostname' => 'localhost', 'port' => 6379, 'database' => 1]], 'session' => ['class' => 'yii\\redis\\Session', 'redis' => ['hostname' => 'localhost', 'port' => 6379, 'database' => 2]], 'authManager' => ['class' => 'yii\\rbac\\DbManager'], 'authClientCollection' => require __DIR__ . '/auth.php', 'assetManager' => ['class' => 'yii\\web\\AssetManager'], 'formatter' => ['defaultTimeZone' => 'UTC', 'datetimeFormat' => 'php:d.mm.Y H:s', 'decimalSeparator' => ',', 'thousandSeparator' => ' ', 'currencyCode' => 'RUB'], 'i18n' => ['class' => common\widgets\yii2TranslatePanel\components\I18N::className(), 'languages' => ['ru', 'de', 'fr'], 'format' => 'db', 'sourcePath' => [__DIR__ . '/../../frontend', __DIR__ . '/../../backend', __DIR__ . '/../../common', __DIR__ . '/../../console'], 'messagePath' => __DIR__ . '/../../messages', 'translations' => ['*' => ['class' => yii\i18n\DbMessageSource::className(), 'enableCaching' => true, 'cachingDuration' => 60 * 60 * 2], 'yii' => ['class' => yii\i18n\DbMessageSource::className(), 'enableCaching' => true, 'cachingDuration' => 60 * 60 * 2], 'app' => ['class' => yii\i18n\DbMessageSource::className(), 'enableCaching' => true, 'cachingDuration' => 60 * 60 * 2]]]]];