<?php $params = array_merge(require __DIR__ . '/../../common/config/params.php', require __DIR__ . '/../../common/config/params-local.php', require __DIR__ . '/params.php', require __DIR__ . '/params-local.php'); return ['as access' => ['class' => yii\filters\AccessControl::className(), 'rules' => [['actions' => ['login', 'error'], 'allow' => true, 'roles' => ['?']], ['allow' => true, 'matchCallback' => function ($rule, $action) { if (common\models\User::findOne(Yii::$app->user->id)) { return common\models\User::findOne(Yii::$app->user->id)->role->name === 'admin'; } }]]], 'id' => 'app-backend', 'basePath' => dirname(__DIR__), 'controllerNamespace' => 'backend\\controllers', 'bootstrap' => ['log'], 'modules' => [], 'components' => ['request' => ['csrfParam' => '_backendCSRF', 'csrfCookie' => ['httpOnly' => true, 'path' => '/admin']], 'user' => ['identityClass' => 'common\\models\\User', 'enableAutoLogin' => true, 'identityCookie' => ['name' => '_backendIdentity', 'path' => '/admin', 'httpOnly' => true]], 'session' => ['name' => 'BACKENDSESSID', 'cookieParams' => ['path' => '/admin']], 'log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [['class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning']]]], 'errorHandler' => ['errorAction' => 'site/error'], 'urlManager' => ['class' => 'yii\\web\\UrlManager', 'showScriptName' => false, 'enablePrettyUrl' => true, 'rules' => ['<action:(login|logout)>' => 'site/<action>', '<controller:\\w+>/<id:\\d+>' => '<controller>/view', '<controller:\\w+>/<action:\\w+>/<id:\\d+>' => '<controller>/<action>', '<controller:\\w+>/<action:\\w+>' => '<controller>/<action>']]], 'params' => $params];
use kartik\widgets\ActiveForm; use kartik\select2\Select2; // or kartik\select2\Select2 use kartik\checkbox\CheckboxX; use yii\web\JsExpression; use yii\helpers\ArrayHelper; use yii\data\Pagination; use common\models\CsServices; use frontend\widgets\ServiceBox; use dosamigos\google\maps\LatLng; use dosamigos\google\maps\overlays\InfoWindow; use dosamigos\google\maps\overlays\Marker; use dosamigos\google\maps\Map; use dosamigos\google\maps\overlays\Circle; $model = common\models\User::findOne(1); $model2 = common\models\User::findOne(22); $coord = new LatLng(['lat' => $model->location->lat, 'lng' => $model->location->lng]); $map = new Map(['center' => $coord, 'zoom' => 10]); $map->width = '100%'; $map->height = '431'; // Lets add a marker now $marker = new Marker(['position' => $coord, 'title' => 'My Home Town']); // Lets add a marker now $circle = new Circle(['center' => $coord, 'radius' => 3000]); // Add marker to the map $map->addOverlay($marker); $map->addOverlay($circle); $map2 = new Map(['center' => $coord, 'zoom' => 14]); $map2->width = '100%'; $map2->height = '176'; // Lets add a marker now
*/ $this->title = $model->name; $this->params['breadcrumbs'][] = ['label' => 'Events', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="event-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php $dataArray = $model->getAttributes(); $dataArray['phone'] = implode(', ', $model->getPhone()); $dataArray['mobile'] = implode(', ', $model->getMobile()); $dataArray['cityname'] = common\models\City::findOne($model->cityId)->name; $dataArray['createdBy'] = common\models\User::findOne($model->createdBy)->firstname; $dataArray['updatedBy'] = common\models\User::findOne($model->updatedBy)->firstname; $dataArray['sourcename'] = $model->sourcename; $dataArray['description'] = strip_tags(HTMLPurifier::process($model->description)); $dataArray['guid'] = 'http://timescity.com' . $model->guid; ?> <?php echo DetailView::widget(['model' => $dataArray, 'attributes' => ['name', ['attribute' => 'cityname', 'label' => 'City'], ['attribute' => 'sourcename', 'label' => 'Source'], ['attribute' => 'startDate', 'label' => 'Start Date', 'format' => 'date'], ['attribute' => 'endDate', 'label' => 'End Date', 'format' => 'date'], ['attribute' => 'startTime', 'label' => 'Start Time'], ['attribute' => 'endTime', 'label' => 'End Time'], 'description:ntext', 'phone', 'mobile', 'contactName', 'email:email', ['attribute' => 'url', 'label' => 'Event URL/Website', 'format' => 'url'], ['attribute' => 'shopurl', 'label' => 'FB URL', 'format' => 'url'], 'price', 'guid:url', 'createdOn', 'createdBy', 'updatedOn', 'updatedBy']]); ?> <?php echo WorkflowButtonsView::widget(['view' => $this, 'model' => $model]); ?> </div>