/** * Returns form * Parameters can be passed to this method via POST method * * Form could have been generated using Yii::ActiveForm (@see http://www.yiiframework.com/doc-2.0/yii-widgets-activeform.html), however, as this is a test I am coding a custom form and custom javascript */ protected function actionForm() { $params = Yii::$app->request->post(); Yii::$app->view->registerJsFile('/js/jquery.validate.js', ['depends' => [JqueryAsset::className()]]); Yii::$app->view->registerJsFile('/js/site.js', ['depends' => [JqueryAsset::className()]]); return $this->renderPartial('form', ['params' => $params]); }
public function init() { $this->sourcePath = __DIR__; $this->js = ['jquery.sortable.min.js']; $this->depends = [JqueryAsset::className()]; parent::init(); }
public function init() { parent::init(); $this->sourcePath = __DIR__ . DIRECTORY_SEPARATOR . 'source'; $this->depends[] = JqueryAsset::className(); $this->depends[] = BootstrapThemeAsset::className(); }
protected function registerAsset() { $jsData = Json::encode($this->data); $setupOptions = Json::encode($this->setupOptions); $js = "\n google.charts.load('current', {packages:[\"orgchart\"]});\n google.charts.setOnLoadCallback(drawChart);\n\n function drawChart() {\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Name');\n data.addColumn('string', 'Manager');\n data.addColumn('string', 'ToolTip');\n\n // For each orgchart box, provide the name, manager, and tooltip to show.\n data.addRows(\n " . $jsData . "\n );\n\n // Create the chart.\n var chart = new google.visualization.OrgChart(document.getElementById('" . $this->id . "'));\n chart.draw(data, {allowHtml:true});\n }\n "; $this->view->registerJsFile('https://www.gstatic.com/charts/loader.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->view->registerJs($js, View::POS_READY); }
public function init() { $this->sourcePath = __DIR__ . '/language'; $this->js = ['js/language.js']; $this->css = ['css/language.css']; $this->depends = [JqueryAsset::className()]; parent::init(); }
public function init() { $this->sourcePath = __DIR__ . '/assets'; $this->js = ['jquery.fancybox.pack.js?v=2.1.5']; $this->css = ['jquery.fancybox.css?v=2.1.5']; $this->depends = [JqueryAsset::className()]; parent::init(); }
public function init() { $this->sourcePath = __DIR__ . '/admin'; $this->js = ['js/admin.js']; $this->css = ['css/admin.css', 'css/widget.css', 'css/styler.css']; $this->depends = [JqueryAsset::className(), 'yii\\web\\YiiAsset', 'yii\\bootstrap\\BootstrapAsset', 'rmrevin\\yii\\fontawesome\\AssetBundle']; parent::init(); }
public function init() { $this->sourcePath = __DIR__ . '/source/language-selector'; $this->js = []; $this->css = ['css/language-selector.css']; $this->depends = [JqueryAsset::className()]; parent::init(); }
public function run() { $asset = \Yii::$app->assetManager->publish("@ercling/loadingindicator/assets", ['forceCopy' => YII_DEBUG]); $this->getView()->registerCssFile($asset[1] . '/themes/' . $this->color . '/pace-theme-' . $this->theme . '.css'); $this->getView()->registerJs(' var yii2LoadingIndicator=' . json_encode($this->options) . '; ', \yii\web\View::POS_BEGIN); $this->getView()->registerJsFile($asset[1] . '/indicator.js', ['depends' => [JqueryAsset::className()]]); }
public function init() { parent::init(); $this->isFollow = Tag::isFollow($this->tagId); if ($this->isFollow) { $this->label = "已关注"; } $this->getView()->registerJsFile('/js/jquery.toggle.js', ['depends' => [JqueryAsset::className()]]); $this->getView()->registerJs("\$('.tagFollowToggle').toggle();"); }
/** * @inheritdoc */ protected function publishExtensionResources() { /** @var View $resourceManager */ $resourceManager = $this->getResourceManager(); // Initialization of extension resources $assetsExt = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'base' . DIRECTORY_SEPARATOR . 'assets'; $assetsPaths = \Yii::$app->getAssetManager()->publish($assetsExt); // [0] - path, [1] - URL $resourceManager->registerJsFile($assetsPaths[1] . '/resource-smart-load.js', ['depends' => [\yii\web\JqueryAsset::className(), \yii\web\YiiAsset::className()]]); }
/** * Registers the clientside widget files (css & js) */ public function registerClientScripts() { $resources = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'resources'; $this->_baseUrl = Yii::$app->getAssetManager()->publish($resources); $this->getView()->registerJsFile($this->_baseUrl[1] . '/menu.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->getView()->registerJsFile($this->_baseUrl[1] . '/selectnav.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->getView()->registerJs(' selectnav(\'myslidemenu\',\'insertHere\'); ', View::POS_END, 'selectnavstart'); $this->getView()->registerCssFile($this->_baseUrl[1] . '/style.css', [], 'horizontal-menu-css'); }
/** * Registers the clientside widget files (css & js) */ public function registerClientScripts() { $resources = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $this->_baseUrl = Yii::$app->getAssetManager()->publish($resources); $this->getView()->registerJsFile($this->_baseUrl[1] . '/jquery.dlmenu.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->getView()->registerJsFile($this->_baseUrl[1] . '/modernizr.custom.js', ['position' => View::POS_HEAD]); $this->getView()->registerJs(' $(\'#dl-menu\').dlmenu({ animationClasses : { classin : \'dl-animate-in-' . $this->transition . '\', classout : \'dl-animate-out-' . $this->transition . '\' } }); ', View::POS_END, 'menuscript'); $this->getView()->registerCssFile($this->_baseUrl[1] . '/component.css', [], 'vertical-menu-css'); }
public function init() { parent::init(); $assets = \Yii::$app->assetManager->publish('@app/modules/comment/assets/', ['forceCopy' => YII_DEBUG]); $this->getView()->registerJsFile($assets['1'] . '/comment.js', ['depends' => [JqueryAsset::className()]]); if ($this->needForm) { $this->model = new Comment(); $this->model->obj_id = $this->obj_id; $this->model->obj_type = $this->obj_type; $this->model->parent_id = $this->parent_id; } $this->comments = Comment::find()->with('author')->where(['obj_type' => $this->obj_type, 'obj_id' => $this->obj_id])->limit(20)->orderBy('id desc')->offset($this->offset)->all(); $this->number = Comment::find()->where(['obj_type' => $this->obj_type, 'obj_id' => $this->obj_id])->count(); }
public function run() { $this->view->registerCssFile('css/treeList.css'); $this->view->registerJsFile('js/treeList.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $result = '<ul class="ul-tree ul-drop">'; foreach ($this->treeList as $key => $val) { $result .= $this->render('treeListLi', ['val' => $val, 'enableDel' => isset($this->treeList[$key + 1]) && $this->treeList[$key + 1]['level'] > $val['level'] ? false : true]); if (isset($this->treeList[$key + 1]) && $this->treeList[$key + 1]['level'] > $val['level']) { $result .= '<ul>'; } if (isset($this->treeList[$key + 1]) && $this->treeList[$key + 1]['level'] == $val['level']) { $result .= '</li>'; } if (isset($this->treeList[$key + 1]) && $this->treeList[$key + 1]['level'] < $val['level']) { $result .= str_repeat('</li>' . '</ul>', $val['level'] - $this->treeList[$key + 1]['level']); } if (!isset($this->treeList[$key + 1])) { $result .= '</li>' . str_repeat('</ul>' . '</li>', $val['level']); } } $result .= '</ul>'; return $result; }
// Tooltips $('[data-toggle="tooltip"]').tooltip(); }()); }); </script> <?php } ?> </div> </div> <script type="text/javascript"> function cambiar($c) { $.ajax({ type: 'POST', url: 'view', data: {consecutivo: $c, id: <?php if(isset($_GET['id'])){ echo $_GET['id'];}else{echo $_POST['id'];} ?>}, success: function(data){ var result = $('<div />').append(data).find('#imagen').html(); $('#imagen').html(result); }, }); }; function zoomin(){ $('#imgPhoto').cropper('zoom', 0.1); } function zoomout(){ $('#imgPhoto').cropper('zoom', -0.1); } </script> <?php $this->registerJsFile('http://localhost:8080/du/web/js/visor.js', ['depends' => [\yii\web\JqueryAsset::className()]]);?>
} else { return $dataProvider->preview; } }], ['label' => Yii::t('app', 'Автор'), 'value' => function ($dataProvider) { return $dataProvider->author->firstname . ' ' . $dataProvider->author->lastname; }], ['attribute' => 'date', 'format' => ['date', 'php:d M yy']], ['attribute' => 'date_create', 'format' => ['date', 'php:d M yy']], ['class' => 'yii\\grid\\ActionColumn', 'header' => Yii::t('app', 'Кнопки действия'), 'template' => '{update} {view} {delete}', 'buttons' => ['view' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', '#', ['class' => 'activity-view-link', 'title' => Yii::t('yii', 'Просмотр'), 'data-toggle' => 'modal', 'data-target' => '#activity-modal', 'data-id' => $key, 'data-pjax' => '0']); }, 'update' => function ($url) { return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['title' => Yii::t('yii', 'Редактировать'), 'data-pjax' => '0', 'target' => '_blank']); }]]]]); ?> <?php Pjax::end(); ?> </div> <?php $this->registerJsFile(Url::base() . '/js/view-modal.js', ['depends' => [\yii\web\JqueryAsset::className()]]); Modal::begin(['id' => 'activity-modal', 'header' => '<h4 class="modal-title">Просмотр</h4>', 'footer' => '<a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>']); ?> <div class="well"> </div> <?php Modal::end(); ?> <?php $this->registerJsFile(Url::base() . '/js/preview.js', ['depends' => [\yii\web\JqueryAsset::className()]]);
echo Yii::$app->request->baseUrl; echo $photo->path; ?> " width="300"/> <?php } else { ?> <img src="holder.js/320x148" style="height: 148px; width: 100%; display: block;"> <?php } ?> </div> <div class="photo-index clearfix" style="margin-bottom:40px;"> <h4>更新图片</h4> <?php $form = ActiveForm::begin(['options' => ['id' => 'post-img', 'enctype' => 'multipart/form-data']]); ?> <?php echo $form->field($model, 'imageFiles[]')->fileInput(['required' => 'required']); ?> <button id="add" class="btn btn-primary">上传</button> <?php ActiveForm::end(); ?> </div> </div> <?php $this->registerJsFile('//cdn.bootcss.com/holder/2.9.1/holder.min.js', ['depends' => [\yii\web\JqueryAsset::className()]]);
$this->beginPage(); ?> <!DOCTYPE html> <html lang="<?php echo Yii::$app->language; ?> "> <head> <meta charset="<?php echo Yii::$app->charset; ?> "> <meta name="viewport" content="width=device-width, initial-scale=1"> <?php $this->registerCssFile("//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"); $this->registerJsFile('//code.jquery.com/ui/1.11.4/jquery-ui.js', ['depends' => [\yii\web\JqueryAsset::className()]]); ?> <?php echo Html::csrfMetaTags(); ?> <title><?php echo Html::encode($this->title); ?> </title> <?php $this->head(); ?> </head> <body> <?php $this->beginBody();
</div> <input type="hidden" name="CountryOrgRel[org_id]" value="<?php echo $org->id; ?> "> <?php echo $form->field($model, 'join_time')->textInput(); ?> <?php echo $form->field($model, 'exit_time')->textInput(); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('app', '加入') : Yii::t('app', '更新'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div> <?php $this->registerCssFile(Yii::$app->request->baseUrl . '/css/bootstrap-datepicker.min.css', [], 'css-datepicker'); $this->registerJsFile(Yii::$app->request->baseUrl . '/js/bootstrap-datepicker.min.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->registerJs("\n\$(function(){\n \$('#countryorgrel-join_time').datepicker({\n format: 'yyyy-mm-dd',\n startDate: '-3d'\n\t});\n\t\$('#countryorgrel-exit_time').datepicker({\n format: 'yyyy-mm-dd',\n startDate: '-3d'\n\t});\n});\n ", View::POS_END, 'editor');
use kartik\select2\Select2; use kartik\file\FileInput; use backend\models\ProductCategory; use backend\models\ProductSpecItem; use backend\models\ProductFiles; use backend\models\ProductPost; use kartik\checkbox\CheckboxX; use kartik\widgets\ActiveForm; use kartik\builder\TabularForm; use kartik\grid\GridView; use yii\widgets\Pjax; use yii\helpers\ArrayHelper; /* @var $this yii\web\View */ /* @var $model backend\models\Product */ /* @var $form yii\widgets\ActiveForm */ $this->registerJsFile(Url::base() . "/files/html.sortable_product_image.js", ['depends' => [\yii\web\JqueryAsset::className()]]); ?> <script type="text/javascript" src="<?php echo Url::base() . "/ckeditor/ckeditor.js"; ?> "></script> <div class="pane" style="float:left; width:100%;"> <h2><span>Update Product Form</span></h2> <div role="tabpanel"> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#general" aria-controls="general" role="tab" data-toggle="tab">General Info</a></li>
</div> <div class="row"> <input type="text" name="mail" placeholder='Электронная почта' /> </div> <div class="row"> <input type="text" class='phone' name="tel" placeholder='Телефон' /> </div> <div class="row"> <textarea name="content" rows="10" placeholder='Текст сообщения'></textarea> </div> <div class="row"> <input type="submit" name="enter" value="Отправить" class="bty" /> </div> </form> --> </div> <div style="clear:both;"></div> </div> <?php $js = " \n \$('#contact-form').validate({\n rules: {\n name: {\n minlength: 3,\n required: true\n },\n tel: {\n required: true\n },\n mail: {\n required: true\n },\n content: {\n required: true\n },\n },\n messages: {\n name: {\n required: 'Нужно указать имя',\n minlength: 'Имя скишком короткое'\n },\n tel: {\n required: 'Нужно указать телефон'\n },\n mail: {\n required: 'Нужно указать Email'\n },\n content: {\n required: 'Напишите сообщение или вопрос'\n }\n },\n success: function(label) {\n label.text('').addClass('valid');\n }\n });\n\n"; $this->registerJsFile('/js/jquery.validate.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->registerJs($js);
</tfoot> <tbody id="det"> </tbody> </table> </td> </tr> </tbody> </table> </div> </div> <?php $this->registerJs("var baseAddress='" . yii\helpers\BaseUrl::base() . "';" . "var accountSelect='" . str_replace("\n", "", $form->field($model, 'ops', ['template' => '{input}'])->dropDownList(\yii\helpers\ArrayHelper::map(Accounts::find()->All(), 'id', 'name'))) . "';" . "var msg='" . Yii::t('app', 'sum is not 0') . "';", \yii\web\View::POS_HEAD); $this->registerJsFile(yii\helpers\BaseUrl::base() . '/assets/transaction.js', ['depends' => [\yii\web\JqueryAsset::className()]]); ?> <div class="form-actions"> <?php echo \yii\helpers\Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-success']); ?> </div> <?php kartik\form\ActiveForm::end(); ?> <?php echo \app\widgets\RefnumModal::widget(['model' => $model, 'attribute' => 'refnum1']);
<?php use app\helpers\UtilityHelpers; use app\helpers\VideoHelpers; use yii\helpers\Url; /** @var \yii\web\View $this */ /** @var \yii\data\ActiveDataProvider $dataProvider */ $this->registerJsFile('/js/videoindex.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->title = Yii::t('app', 'List Video'); ?> <ul class="timeline"> <?php if (empty($dataProvider->getModels())) { ?> <li class="time-label"> <span class="bg-red"> <?php echo Yii::t('app', '{0, date, d MMM Y}', strtotime('now')); ?> </span> </li> <!-- timeline item --> <li> <i class="fa fa-video-camera bg-maroon"></i> <div class="timeline-item"> <div class="timeline-body"> <div style=" width: 50%; margin: 0 auto;
<p> <?php //echo Html::a('Create Roles', ['create'], ['class' => 'btn btn-success']) ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "{summary}\n{items}\n{pager}", 'panel' => ['type' => GridView::TYPE_SUCCESS, 'heading' => $this->render('_search', ['model' => $searchModel])], 'toolbar' => [['content' => Html::a('สร้างใหม่', ['create'], ['class' => 'btn btn-primary'])], '{toggleData}', '{export}'], 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'header' => 'ลำดับ', 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'text-align: center']], 'rolename', 'description:ntext', 'createdate', ['header' => 'Action', 'headerOptions' => ['style' => 'width: 160px;text-align:center;', 'class' => 'activity-view-link'], 'class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['style' => 'text-align: center'], 'buttons' => ['view' => function ($url, $data, $index) { $options = ['title' => Yii::t('yii', 'View'), 'aria-label' => Yii::t('yii', 'View'), 'data-pjax' => '0']; return Html::a('<span class="glyphicon glyphicon-eye-open btn btn-default"></span>', $url, $options); }, 'update' => function ($url, $data, $index) { $options = array_merge(['title' => Yii::t('yii', 'Update'), 'aria-label' => Yii::t('yii', 'Update'), 'data-pjax' => '0', 'id' => 'modaledit']); return Html::a('<span class="glyphicon glyphicon-pencil btn btn-default"></span>', $url, ['id' => 'activity-view-link', 'data-id' => $index, 'data-pjax' => '0']); }, 'delete' => function ($url, $data, $index) { $options = array_merge(['title' => Yii::t('yii', 'Delete'), 'aria-label' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']); return Html::a('<span class="glyphicon glyphicon-trash btn btn-default"></span>', $url, $options); }]]]]); ?> </div> <div class="pagename" <?php echo "id={$pagename}"; ?> ></div> <?php $this->registerJsFile(Yii::$app->request->baseUrl . '/js/leftmenu.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->registerJs(' var path = location.pathname; //console.log(path); ');
public function init() { parent::init(); $this->depends[] = JqueryAsset::className(); }
}*/ /*$root = Category::findOne(['name' => 'Provinsi']); // We need to find our children. We don't do this lazily because it can be // advantageous to control when it happens. You may wish to provide a // $depth limit to speed up queries even more. $depth = 2; // This will limit to countries & states only for example $root->children($depth)->all(); // We can now loop through our children foreach ($root->children()->all() as $category) { echo "<h3>{$category->name}</h3>"; if (count($category->children()->all())) { echo "<p>{$category->name} has the following states registered with our system:</p>"; echo "<ul>"; foreach ($category->children()->all() as $state) { echo "<li>{$state->name}</li>"; } echo "</ul>"; } }*/ $this->registerCssFile('../jstree/themes/default/style.min.css'); $this->registerJsFile('../admin/jstree/jstree.min.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->registerJs("\n\$('#jstree_demo_div')\n.on('changed.jstree', function (e, data) {\n var i, j, r = [];\n for(i = 0, j = data.selected.length; i < j; i++) {\n r.push(data.instance.get_node(data.selected[i]).text);\n }\n \$('#category-parent').val(r.join(', '));\n })\n.jstree();\n");
<!--<script src="//code.jquery.com/jquery-1.12.0.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>--> <script src="/../../assets/pluginDropdown/docsupport/prism.js"></script> <link href="/../../assets/pluginDropdown/docsupport/prism.css" type="text/css" rel="stylesheet" /> <script src="/../../assets/pluginDropdown/chosen.jquery.js"></script> <link href="/../../assets/pluginDropdown/chosen.css" type="text/css" rel="stylesheet" /> <script type="text/javascript"> $(document).ready(function($){ $('.chosen-select-width').chosen(); }); </script> <script src="/../../js/funciones.js" type="text/javascript"></script> <script src="/../../js/jquery.simplePagination.js" type="text/javascript"></script> <?php $this->registerJsFile(Yii::$app->request->baseUrl . '/assets/pluginDropdown/chosen.jquery.js', ['depends' => [\yii\web\JqueryAsset::className()]]); ?> <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" /> </head> <body> <?php $this->beginBody(); ?> <div class="wrap"> <?php NavBar::begin(['brandLabel' => 'APROA', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top', 'id' => 'topmenu']]); echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => [['label' => 'Home', 'url' => Yii::$app->homeUrl], ['label' => 'Origen', 'url' => ['/precios/origen']], ['label' => 'Mayoristas', 'url' => ['/precios/mayoristas']], ['label' => 'Supermercados', 'url' => ['/precios/supermercados']], ['label' => 'Precios Ponderados', 'url' => ['/site/preciosponderados']], ['label' => 'Pizarra', 'url' => ['/precios/pizarraprecios']], Yii::$app->user->isGuest ? ['label' => 'Login', 'url' => ['/site/login']] : ['label' => 'Logout (' . Yii::$app->user->identity->usuario . ')', 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post']]]]); NavBar::end(); ?>
<?php /** * if this view can't show , you should install imagick for php,The EasyThumbnailImage depend on it */ use himiklab\thumbnail\EasyThumbnailImage; use star\system\models\Tree; use yii\helpers\Url; /** @var $itemModel \star\catalog\models\Item*/ $link = $this->getAssetManager()->getPublishedUrl('@theme/home/default/assets'); $this->registerJsFile($link . '/js/fsku.js', ['depends' => [\yii\web\JqueryAsset::className()]]); $this->registerCssFile($link . '/css/sku.css'); $this->params['breadcrumbs'][] = ['label' => Yii::t('catalog', 'Item View'), 'template' => '<li><span>{link}</span></li>']; ?> <!--content--> <div class="page_content_offset"> <div class="container"> <div class="row clearfix"> <!--left content column--> <section class="col-lg-9 col-md-9 col-sm-9 m_xs_bottom_30"> <div class="clearfix m_bottom_30 t_xs_align_c"> <div class="photoframe type_2 shadow r_corners f_left f_sm_none d_xs_inline_b product_single_preview relative m_right_30 m_bottom_5 m_sm_bottom_20 m_xs_right_0 w_mxs_full"> <span class="hot_stripe"><img src="images/sale_product.png" alt=""></span> <div class="relative d_inline_b m_bottom_10 qv_preview d_xs_block"> <?php $mainImage = isset($itemImages[0]) ? $itemImages[0]->pic : ''; ?> <?php echo EasyThumbnailImage::thumbnailImg('@image/' . $mainImage, 430, 430, EasyThumbnailImage::THUMBNAIL_OUTBOUND, ['alt' => $itemImages[0]->title, 'id' => "zoom_image", "data-zoom-image" => Yii::$app->params['imageDomain'] . '/' . $mainImage, "class" => "tr_all_hover"]); ?> <a href="<?php
use app\models\Author; use yii\helpers\Html; use yii\widgets\ActiveForm; use yii\helpers\ArrayHelper; use dosamigos\datepicker\DatePicker; /* @var $this yii\web\View */ /* @var $model app\models\Book */ /* @var $form yii\widgets\ActiveForm */ ?> <?php $authors = ArrayHelper::map(Author::find()->orderBy('lastname')->all(), 'id', 'fullname'); ?> <?php $this->registerJsFile('js/main.js', ['depends' => [\yii\web\JqueryAsset::className()]]); ?> <div class="book-form"> <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?> <div class="row"> <div class="col col-sm-4"> <?php echo $form->field($model, 'previewFile')->fileInput(array('id' => 'uploadCtl')); ?> <img id="preview" <?php