本文整理汇总了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]);
}
示例2: init
public function init()
{
$this->sourcePath = __DIR__;
$this->js = ['jquery.sortable.min.js'];
$this->depends = [JqueryAsset::className()];
parent::init();
}
示例3: init
public function init()
{
parent::init();
$this->sourcePath = __DIR__ . DIRECTORY_SEPARATOR . 'source';
$this->depends[] = JqueryAsset::className();
$this->depends[] = BootstrapThemeAsset::className();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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()]]);
}
示例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();");
}
示例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()]]);
}
示例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');
}
示例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');
}
示例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();
}
示例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;
}
示例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()]]);?>