当前位置: 首页>>代码示例>>PHP>>正文


PHP JqueryAsset::className方法代码示例

本文整理汇总了PHP中yii\web\JqueryAsset::className方法的典型用法代码示例。如果您正苦于以下问题:PHP JqueryAsset::className方法的具体用法?PHP JqueryAsset::className怎么用?PHP JqueryAsset::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\web\JqueryAsset的用法示例。


在下文中一共展示了JqueryAsset::className方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionForm

 /**
  * 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]);
 }
开发者ID:rajanrx,项目名称:vermilian-test,代码行数:13,代码来源:CommentController.php

示例2: init

 public function init()
 {
     $this->sourcePath = __DIR__;
     $this->js = ['jquery.sortable.min.js'];
     $this->depends = [JqueryAsset::className()];
     parent::init();
 }
开发者ID:webvimark,项目名称:ybc-content,代码行数:7,代码来源:SortableAsset.php

示例3: init

 public function init()
 {
     parent::init();
     $this->sourcePath = __DIR__ . DIRECTORY_SEPARATOR . 'source';
     $this->depends[] = JqueryAsset::className();
     $this->depends[] = BootstrapThemeAsset::className();
 }
开发者ID:novokshonovev,项目名称:multi-string-widget,代码行数:7,代码来源:MultiStringAsset.php

示例4: registerAsset

 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);
 }
开发者ID:kongoon,项目名称:yii2-orgchart,代码行数:8,代码来源:OrgChart.php

示例5: init

 public function init()
 {
     $this->sourcePath = __DIR__ . '/language';
     $this->js = ['js/language.js'];
     $this->css = ['css/language.css'];
     $this->depends = [JqueryAsset::className()];
     parent::init();
 }
开发者ID:yeesoft,项目名称:yii2-yee-core,代码行数:8,代码来源:LanguagePillsAsset.php

示例6: 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();
 }
开发者ID:yeesoft,项目名称:yii2-yee-core,代码行数:8,代码来源:YeeAsset.php

示例7: init

 public function init()
 {
     $this->sourcePath = __DIR__ . '/source/language-selector';
     $this->js = [];
     $this->css = ['css/language-selector.css'];
     $this->depends = [JqueryAsset::className()];
     parent::init();
 }
开发者ID:yeesoft,项目名称:yii2-yee-core,代码行数:8,代码来源:LanguageSelectorAsset.php

示例8: run

 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()]]);
 }
开发者ID:ercling,项目名称:yii2-loadingindicator,代码行数:9,代码来源:Indicator.php

示例9: init

 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();");
 }
开发者ID:awebc,项目名称:web_xbf,代码行数:10,代码来源:FollowBtn.php

示例10: publishExtensionResources

 /**
  * @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()]]);
 }
开发者ID:istranger,项目名称:yii2-resource-smart-load,代码行数:13,代码来源:RSmartLoad.php

示例11: registerClientScripts

    /**
     * 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');
    }
开发者ID:host33,项目名称:yii2-multilevel-horizontal-menu,代码行数:14,代码来源:MultilevelHorizontalMenu.php

示例12: registerClientScripts

    /**
     * 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');
    }
开发者ID:host33,项目名称:yii2-multilevel-vertical-menu,代码行数:16,代码来源:MultilevelVerticalMenu.php

示例13: init

 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();
 }
开发者ID:awebc,项目名称:web_xbf,代码行数:14,代码来源:CommentList.php

示例14: run

 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;
 }
开发者ID:Zlatov,项目名称:yii2test,代码行数:23,代码来源:TreeList.php

示例15: cambiar

    // 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()]]);?>
开发者ID:rzamarripa,项目名称:du,代码行数:30,代码来源:view.php


注:本文中的yii\web\JqueryAsset::className方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。