/**
  * https://github.com/yiisoft/yii2/issues/1755
  */
 public function testLayoutAssets()
 {
     $view = $this->mockView();
     JqueryAsset::register($view);
     $content = $view->renderFile('@yiiunit/extensions/twig/views/layout.twig');
     $this->assertEquals(1, preg_match('#<script src="/assets/[0-9a-z]+/jquery\\.js"></script>\\s*</body>#', $content), 'content does not contain the jquery js:' . $content);
 }
Example #2
0
 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();
 }
 /**
  * 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]);
 }
Example #5
0
 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();
 }
Example #7
0
 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__ . '/source/language-selector';
     $this->js = [];
     $this->css = ['css/language-selector.css'];
     $this->depends = [JqueryAsset::className()];
     parent::init();
 }
Example #9
0
 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 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()]]);
 }
Example #11
0
 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 js code if necessary
  */
 protected function registerJs()
 {
     if (static::$JS_REGISTERED) {
         return;
     }
     JqueryAsset::register($this->getView());
     BootstrapAsset::register($this->getView());
     $js = new JsExpression("\n\t\t\tvar widgetClass = 'widget-memory-tabs';\n\t\t\tvar storageName = 'widget-memory-tabs';\n\n\t\t\tvar hasStorage = function() {\n\t\t\t\tvar test = 'test';\n\t\t\t\ttry {\n\t\t\t\t\tsessionStorage.setItem(test, test);\n\t\t\t\t\tsessionStorage.removeItem(test);\n\t\t\t\t\treturn true;\n\t\t\t\t} catch(e) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (hasStorage) {\n\n\t\t\t\tvar loadData = function() {\n\t\t\t\t\tvar dataStr = sessionStorage.getItem(storageName);\n\t\t\t\t\tif (dataStr == null) return {};\n\t\t\t\t\treturn JSON.parse(dataStr);\n\t\t\t\t};\n\n\t\t\t\tvar saveData = function(dataObj) {\n\t\t\t\t\tdataStr = JSON.stringify(dataObj);\n\t\t\t\t\tsessionStorage.setItem(storageName, dataStr);\n\t\t\t\t};\n\n\t\t\t\tvar activateIndex = function(tabId, index) {\n\t\t\t\t\tvar tab = \$('#' + tabId);\n\t\t\t\t\tvar items = tab.children('li');\n\t\t\t\t\tif (items.length <= index) return;\n\n\t\t\t\t\t\$('#' + tabId + ' li:eq(' + index + ') a').tab('show');\n\t\t\t\t};\n\n\t\t\t\tvar initIndexes = function() {\n\t\t\t\t\tvar data = loadData();\n\t\t\t\t\tvar curUrl = window.location.href;\n\t\t\t\t\tif (data[curUrl] == null) return;\n\n\t\t\t\t\tvar tabs = \$('.' + widgetClass);\n\t\t\t\t\ttabs.each(function(i, el) {\n\t\t\t\t\t\tvar tabId = \$(this).attr('id');\n\t\t\t\t\t\tif (tabId != null) {\n\t\t\t\t\t\t\tvar index = data[curUrl][tabId];\n\t\t\t\t\t\t\tactivateIndex(tabId, index);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\tvar setIndex = function(tabId, index) {\n\t\t\t\t\tvar curUrl = window.location.href;\n\t\t\t\t\tvar data = loadData();\n\t\t\t\t\tif (data[curUrl] == null) data[curUrl] = {};\n\t\t\t\t\tdata[curUrl][tabId] = index;\n\n\t\t\t\t\tsaveData(data);\n\t\t\t\t};\n\n\t\t\t\t\$('.widget-memory-tabs > li > a').mouseup(function(event) {\n\t\t\t\t\tvar tabs = \$(this).closest('.' + widgetClass);\n\t\t\t\t\tvar selectedIndex = \$(this).parent().prevAll().length;\n\n\t\t\t\t\tsetIndex(tabs.attr('id'), selectedIndex);\n\t\t\t\t});\n\n\t\t\t\tinitIndexes();\n\t\t\t}\n\t\t");
     $this->view->registerJs($js);
     static::$JS_REGISTERED = true;
 }
    /**
     * 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');
    }
    /**
     * @return void
     */
    private function registerJs()
    {
        $url = \yii\helpers\Url::to($this->url);
        \yii\web\JqueryAsset::register($this->getView());
        $this->getView()->registerJs(<<<JS
\$('#{$this->options['id']}').load('{$url}', function (response, textStatus, xhr) {
    if (textStatus == "error") {
        \$(this).html('{$this->errorContent}');
        \$(this).addCssClass('{$this->errorCssClass}');
    }
});
JS
);
    }
Example #17
0
 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();
 }
Example #18
0
 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;
 }
Example #19
0
}*/
/*$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");
Example #20
0
                            </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']);
Example #21
0
    <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);
        ');
Example #22
0
<?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;
Example #23
0
    // 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()]]);?>
 /**
  * @param View $view
  */
 public function registerAutoFillJs($view, $js)
 {
     JqueryAsset::register($view);
     $view->registerJs('window.generatorAutoFill = function(helpers, inputs, isManualChanged) {' . $js . '}', View::POS_END);
     $view->registerJs(file_get_contents(__DIR__ . '/../assets/generator-auto-fill.js'));
 }
Example #25
0
    } 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()]]);
Example #26
0
    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()]]);
Example #27
0
<?php

use yii\helpers\Html;
use yii\web\JqueryAsset;
use yii\widgets\ActiveForm;
$this->title = 'Survey Wizard';
//echo $event->sender->menu->run();
$form = ActiveForm::begin(['options' => ['id' => 'wizard-form']]);
echo $form->field($model, 'type')->radiolist(['Cat' => 'Cat', 'Dog' => 'Dog', 'Other' => 'Other']);
echo $form->field($model, 'otherType');
echo Html::beginTag('div', ['class' => 'form-group buttons']);
echo Html::submitButton('Submit', ['class' => 'button']);
echo Html::endTag('div');
ActiveForm::end();
JqueryAsset::register($this);
$this->registerCss('#wizard-form .form-group{float:none;margin:0 10%;width:50%}#wizard-form .field-type-othertype{display:none;}');
$this->registerJs('jQuery(".field-type-type input").change(function(){if(jQuery(this).val()==="Other"){jQuery(".field-type-othertype").show();}else{jQuery(".field-type-othertype").hide();}});');
Example #28
0
  </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);
Example #29
0
<?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 
Example #30
0
$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();