• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Booster类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Booster的典型用法代码示例。如果您正苦于以下问题:PHP Booster类的具体用法?PHP Booster怎么用?PHP Booster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: registerClientScript

 /**
  * Publishes and registers the necessary script files.
  */
 protected function registerClientScript()
 {
     $assets = Booster::getBooster()->cs;
     $assets->registerPackage('highcharts');
     $baseUrl = $assets->packages['highcharts']['baseUrl'];
     $this->options = CMap::mergeArray(array('exporting' => array('enabled' => true)), $this->options);
     if (isset($this->options['exporting']) && @$this->options['exporting']['enabled']) {
         $assets->registerScriptFile($baseUrl . '/modules/exporting.js');
     }
     if (isset($this->options['theme'])) {
         $assets->registerScriptFile($baseUrl . '/themes/' . $this->options['theme'] . '.js');
     }
     $options = CJavaScript::encode($this->options);
     $assets->registerScript(__CLASS__ . '#' . $this->getId(), "var highchart{$this->getId()} = new Highcharts.Chart({$options});");
 }
开发者ID:zhaoyan158567,项目名称:YiiBooster,代码行数:18,代码来源:TbHighCharts.php


示例2: init

 /**
  *### .init()
  *
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $booster = Booster::getBooster();
     $popover = $booster->popoverSelector;
     $tooltip = $booster->tooltipSelector;
     $afterAjaxUpdate = "js:function() {\n\t\t\tjQuery('.popover').remove();\n\t\t\tjQuery('{$popover}').popover();\n\t\t\tjQuery('.tooltip').remove();\n\t\t\tjQuery('{$tooltip}').tooltip();\n\t\t}";
     if (!isset($this->afterAjaxUpdate)) {
         $this->afterAjaxUpdate = $afterAjaxUpdate;
     }
 }
开发者ID:zhaoyan158567,项目名称:YiiBooster,代码行数:16,代码来源:TbListView.php


示例3: UsesBootstrapCssDependingOnSwitches

 /**
  * @test
  * @dataProvider BootstrapCssFilenames
  *
  * @param $cdn
  * @param $responsive
  * @param $fontawesome
  * @param $mincss
  * @param $expected_filename
  */
 public function UsesBootstrapCssDependingOnSwitches($cdn, $responsive, $fontawesome, $mincss, $expected_filename)
 {
     $component = new Booster();
     $component->_assetsUrl = 'assets';
     $component->cs = new AssetsRegistryHook();
     $component->enableCdn = $cdn;
     $component->responsiveCss = $responsive;
     $component->fontAwesomeCss = $fontawesome;
     $component->minify = $mincss;
     $component->init();
     $component->registerBootstrapCss();
     $this->assertTrue($component->cs->hasRegisteredCssFile($expected_filename));
 }
开发者ID:zhaoyan158567,项目名称:YiiBooster,代码行数:23,代码来源:BootstrapTest.php


示例4: creeFormatter

 /**
  * Crée un formatter (objet qui va manipuler le résultat XML filtré et créer le résultat sous la forme voulue : XML ou ICS).
  * Cette méthode n'est pas terrible, elle devrait être fusionnée avec creeBooster().
  */
 public static function creeFormatter($type, Booster $booster)
 {
     $formatter = null;
     switch ($type) {
         case self::$ICAL:
             $icsData = self::getFile("/web/publi/etu/" . $booster->getResource() . ".ics");
             $formatter = new ICal($icsData);
             break;
         default:
             $formatter = new XMLCal();
             break;
     }
     return $formatter;
 }
开发者ID:bloron,项目名称:celcatbooster,代码行数:18,代码来源:Fabrique.class.php


示例5: init

 /**
  *### .init()
  *
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $classes = array('table');
     if (isset($this->type)) {
         if (is_string($this->type)) {
             $this->type = explode(' ', $this->type);
         }
         if (!empty($this->type)) {
             $validTypes = array(self::TYPE_STRIPED, self::TYPE_BORDERED, self::TYPE_CONDENSED, self::TYPE_HOVER);
             foreach ($this->type as $type) {
                 if (in_array($type, $validTypes)) {
                     $classes[] = 'table-' . $type;
                 }
             }
         }
     }
     if (!empty($classes)) {
         $classes = implode(' ', $classes);
         if (isset($this->itemsCssClass)) {
             $this->itemsCssClass .= ' ' . $classes;
         } else {
             $this->itemsCssClass = $classes;
         }
     }
     $booster = Booster::getBooster();
     $popover = $booster->popoverSelector;
     $tooltip = $booster->tooltipSelector;
     $afterAjaxUpdate = "js:function() {\n\t\t\tjQuery('.popover').remove();\n\t\t\tjQuery('{$popover}').popover();\n\t\t\tjQuery('.tooltip').remove();\n\t\t\tjQuery('{$tooltip}').tooltip();\n\t\t}";
     if (!isset($this->afterAjaxUpdate)) {
         $this->afterAjaxUpdate = $afterAjaxUpdate;
     }
 }
开发者ID:zhaoyan158567,项目名称:YiiBooster,代码行数:38,代码来源:TbGridView.php


示例6: renderHeaderCellContent

 /**
  *### .renderHeaderCellContent()
  *
  * Renders the header cell content.
  * This method will render a link that can trigger the sorting if the column is sortable.
  */
 protected function renderHeaderCellContent()
 {
     if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
         $sort = $this->grid->dataProvider->getSort();
         $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);
         $booster = Booster::getBooster();
         if ($sort->resolveAttribute($this->name) !== false) {
             $label .= ' <span class="caret"></span>';
         }
         /* {
         			if($sort->getDirection($this->name) === CSort::SORT_ASC){
                       		$label .= ' <span class="'.($booster->fontAwesomeCss ? 'fa fa-sort-asc' : 'icon-chevron-down').'"></span>';
                        } elseif($sort->getDirection($this->name) === CSort::SORT_DESC){
                        	$label .= ' <span class="'.($booster->fontAwesomeCss ? 'fa fa-sort-desc' : 'icon-chevron-up').'"></span>';
                        } else {
                        	$label .= ' ';
                        }
                    } */
         echo $sort->link($this->name, $label, array('class' => 'sort-link'));
     } else {
         if ($this->name !== null && $this->header === null) {
             if ($this->grid->dataProvider instanceof CActiveDataProvider) {
                 echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
             } else {
                 echo CHtml::encode($this->name);
             }
         } else {
             parent::renderHeaderCellContent();
         }
     }
 }
开发者ID:Aldanzein,项目名称:bursa-kerja,代码行数:37,代码来源:TbDataColumn.php


示例7: registerClientScript

 /**
  *### .registerClientScript()
  *
  * Registers required client script for chosen. It is not used through bootstrap->registerPlugin
  * in order to attach events if any
  */
 public function registerClientScript($id)
 {
     Booster::getBooster()->registerPackage('chosen');
     $options = !empty($this->options) ? CJavaScript::encode($this->options) : '';
     ob_start();
     echo "\$('#{$id}').chosen({$options})";
     Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean() . ';');
 }
开发者ID:FavorMylikes,项目名称:ResumeManager,代码行数:14,代码来源:TbChosen.php


示例8: registerClientScript

 /**
  * Register required script files
  */
 public function registerClientScript()
 {
     $booster = Booster::getBooster();
     $booster->registerPackage('markdown');
     $id = $this->htmlOptions['id'];
     $options = CJSON::encode($this->options);
     Yii::app()->clientScript->registerScript(__CLASS__ . '#' . $id, "\n\t\t\t\$('#{$id}').markdown({$options})\n\t\t\t", CClientScript::POS_END);
 }
开发者ID:FavorMylikes,项目名称:ResumeManager,代码行数:11,代码来源:TbMarkdownEditor.php


示例9: registerClientScript

 /**
  * Register required script files
  *
  * @param integer $id        	
  */
 public function registerClientScript($id)
 {
     $booster = Booster::getBooster();
     $booster->registerAssetCss('markdown.editor.css');
     $booster->registerAssetJs('markdown.converter.js', CClientScript::POS_HEAD);
     $booster->registerAssetJs('markdown.sanitizer.js', CClientScript::POS_HEAD);
     $booster->registerAssetJs('markdown.editor.js', CClientScript::POS_HEAD);
     Yii::app()->clientScript->registerScript($id, "var converter = Markdown.getSanitizingConverter();\n\t\t\tvar editor = new Markdown.Editor(converter, '" . $id . "');\n\t\t\teditor.run();", CClientScript::POS_END);
 }
开发者ID:josefd8,项目名称:dashboardWeb,代码行数:14,代码来源:TbMarkdownEditorJs.php


示例10: init

 /**
  *
  */
 public function init()
 {
     Booster::getBooster()->registerPackage('ui-layout');
     if (!is_array($this->options)) {
         $this->options = array();
     }
     if (!is_array($this->htmlOptions)) {
         $this->htmlOptions = array();
     }
 }
开发者ID:Aldanzein,项目名称:bursa-kerja,代码行数:13,代码来源:TbUiLayout.php


示例11: registerClientScript

 /**
  *### .registerClientScript()
  *
  * Registers required
  *
  * @param string $id
  */
 public function registerClientScript($id)
 {
     Booster::getBooster()->cs->registerPackage('colorpicker');
     $options = !empty($this->format) ? CJavaScript::encode(array('format' => $this->format)) : '';
     ob_start();
     echo "jQuery('#{$id}').colorpicker({$options})";
     foreach ($this->events as $event => $handler) {
         echo ".on('{$event}', " . CJavaScript::encode($handler) . ")";
     }
     Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean() . ';');
 }
开发者ID:zhaoyan158567,项目名称:YiiBooster,代码行数:18,代码来源:TbColorPicker.php


示例12: registerClientScript

    /**
     * Registers required client script for bootstrap select2. It is not used through bootstrap->registerPlugin
     * in order to attach events if any
     * @param $id
     * @throws CException
     */
    public function registerClientScript($id)
    {
        Booster::getBooster()->registerPackage('select2');
        if (empty($this->options['language']) && empty($this->htmlOptions['lang'])) {
            $this->options['language'] = Yii::app()->language;
        }
        if (!empty($this->value) || $this->value === 0 || $this->value === '0') {
            if (is_array($this->value)) {
                $value = CJSON::encode($this->value);
            } else {
                $value = '"' . $this->value . '"';
            }
            //trigger maybe removed
            $defValue = ".val({$value}).trigger('change')";
        } else {
            $defValue = '';
        }
        if ($this->disabled) {
            $defValue .= ".prop('disabled', true)";
        }
        $options = CJavaScript::encode($this->options);
        ob_start();
        echo "jQuery('select#{$id}').select2({$options});";
        if (!empty($defValue)) {
            echo "jQuery('select#{$id}')" . $defValue . ';';
        }
        if (count($this->events) > 0) {
            echo "jQuery('select#{$id}')";
            foreach ($this->events as $event => $handler) {
                echo ".on('{$event}', " . CJavaScript::encode($handler) . ")";
            }
            echo ';';
        }
        if (!empty($this->initialData)) {
            $data = CJavaScript::encode($this->initialData);
            $js = <<<JS
var data = {$data};
if(!\$.isArray(data)) {
\tdata = [data];
}
\$.each(data, function(index, value){
\tvar option = \$("<option selected></option>").val(value.id).data('data',value);
\t\$('select#{$id}').append(option);
});
\$('select#{$id}').trigger('change');
JS;
            echo $js;
        }
        Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean());
    }
开发者ID:strong2much,项目名称:YiiBooster3,代码行数:56,代码来源:TbSelect2.php


示例13: registerLanguageScript

 public function registerLanguageScript()
 {
     $booster = Booster::getBooster();
     if (isset($this->options['language']) && $this->options['language'] != 'en') {
         $filename = '/bootstrap-datepicker/js/locales/bootstrap-datepicker.' . $this->options['language'] . '.js';
         if (file_exists(Yii::getPathOfAlias('booster.assets') . $filename)) {
             if ($booster->enableCdn) {
                 Yii::app()->clientScript->registerScriptFile('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.2.0/js/locales/bootstrap-datepicker.' . $this->options['language'] . '.js', CClientScript::POS_HEAD);
             } else {
                 $booster->cs->registerScriptFile($booster->getAssetsUrl() . $filename, CClientScript::POS_HEAD);
             }
         }
     }
 }
开发者ID:zhaoyan158567,项目名称:YiiBooster,代码行数:14,代码来源:TbDatePicker.php


示例14: registerClientScript

 /**
  * Registers required css and js files
  *
  * @param integer $id the id of the toggle button
  */
 protected function registerClientScript($id)
 {
     $booster = Booster::getBooster();
     $booster->registerPackage('switch');
     $config = CJavaScript::encode($this->options);
     ob_start();
     echo "\$('#{$id}').bootstrapSwitch({$config})";
     foreach ($this->events as $event => $handler) {
         $event = $event . '.bootstrapSwitch';
         if (!$handler instanceof CJavaScriptExpression && strpos($handler, 'js:') === 0) {
             $handler = new CJavaScriptExpression($handler);
         }
         echo ".on('{$event}', " . $handler . ")";
     }
     Yii::app()->clientScript->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean() . ';');
 }
开发者ID:Aldanzein,项目名称:bursa-kerja,代码行数:21,代码来源:TbSwitch.php


示例15: init

 public function init()
 {
     $booster = Booster::getBooster();
     $booster->registerAssetCss('bootstrap-image-gallery' . (!YII_DEBUG ? '.min' : '') . '.css');
     $booster->registerAssetJs('fileupload/load-image.min.js');
     $booster->registerAssetJs('bootstrap-image-gallery' . (!YII_DEBUG ? '.min' : '') . '.js');
     if ($this->fullScreen) {
         Yii::app()->clientScript->registerScript($this->id, 'jQuery("#' . $this->id . '").addClass("modal-fullscreen");', CClientScript::POS_READY);
     }
     if (!$this->eventListener) {
         Yii::app()->clientScript->registerScript($this->id, '$(document.body).off(".modal-gallery.data-api");');
     }
     if (!isset($this->htmlOptions['id'])) {
         $this->htmlOptions['id'] = $this->id;
     }
     echo CHtml::openTag('div', CMap::mergeArray(self::$defaultHtmlOptions, $this->htmlOptions));
 }
开发者ID:josefd8,项目名称:dashboardWeb,代码行数:17,代码来源:TbImageGallery.php


示例16: registerClientScript

 /**
  * Registers required
  *
  * @param integer $id        	
  */
 public function registerClientScript($id)
 {
     $booster = Booster::getBooster();
     $booster->registerAssetJs('bootstrap-modalmanager.js', CClientScript::POS_HEAD);
     $booster->registerAssetCss('bootstrap-modalmanager.css');
     $options = !empty($this->format) ? CJavaScript::encode(array('format' => $this->format)) : '';
     ob_start();
     echo "jQuery('#{$id}').modalmanager({$options})";
     foreach ($this->events as $event => $handler) {
         echo ".on('{$event}', " . CJavaScript::encode($handler) . ")";
     }
     Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean() . ';');
     foreach ($this->events as $name => $handler) {
         $handler = CJavaScript::encode($handler);
         Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $id . '_' . $name, "jQuery('#{$id}').on('{$name}', {$handler});");
     }
 }
开发者ID:josefd8,项目名称:dashboardWeb,代码行数:22,代码来源:TbModalManager.php


示例17: registerClientScript

    /**
     * Publishes and registers the necessary script files.
     */
    protected function registerClientScript()
    {
        $assets = Booster::getBooster()->cs;
        $assets->registerCss(__CLASS__ . '#sidebar-toggle', '
					#' . $this->wrapper . '.toggled #' . $this->sidebar . ' {
					    width: 0px;
					}
					#' . $this->wrapper . '.toggled #' . $this->content . ' {
					   width: 100%;
					   margin-left: 0px;
					}
					');
        $assets->registerScript(__CLASS__ . '#sidebar-toggle', '
                $("#sidebar-toggle").click(function(){  
                    $("#' . $this->wrapper . '").toggleClass("toggled");  
                });
            ', CClientScript::POS_LOAD);
    }
开发者ID:ednjv,项目名称:SSBMVZLA,代码行数:21,代码来源:TbToggleNavbar.php


示例18: registerClientScript

    function registerClientScript()
    {
        $booster = Booster::getBooster();
        $booster->registerPackage('typeahead');
        if (empty($this->datasets) || !isset($this->datasets['source']) || !is_array($this->datasets['source'])) {
            return;
        }
        Yii::app()->clientScript->registerScript(__CLASS__ . '#substringMatcher', '
			var substringMatcher = function(strs) {
				return function findMatches(q, cb) {
					var matches, substringRegex;
					 
					// an array that will be populated with substring matches
					matches = [];
					 
					// regex used to determine if a string contains the substring `q`
					substrRegex = new RegExp(q, "i");
					 
					// iterate through the pool of strings and for any string that
					// contains the substring `q`, add it to the `matches` array
					$.each(strs, function(i, str) {
						if (substrRegex.test(str)) {
							// the typeahead jQuery plugin expects suggestions to a
							// JavaScript object, refer to typeahead docs for more info
							matches.push({ value: str });
						}
					});
					 
					cb(matches);
				};
			};
		', CClientScript::POS_HEAD);
        $source_list = !empty($this->options) ? CJavaScript::encode($this->datasets['source']) : '';
        Yii::app()->clientScript->registerScript(__CLASS__ . '#source_list#' . $this->id, '
			var _' . $this->id . '_source_list = ' . $source_list . ';
		', CClientScript::POS_HEAD);
    }
开发者ID:zhaoyan158567,项目名称:YiiBooster,代码行数:37,代码来源:TbTypeahead.php


示例19: registerClientScript

 /**
  * Register required script files
  */
 public function registerClientScript()
 {
     $assets = Booster::getBooster()->cs;
     $assets->registerPackage('redactor');
     $baseUrl = $assets->packages['redactor']['baseUrl'];
     // Prepend language file to scripts package.
     if ($this->editorOptions['lang'] != 'en') {
         $assets->registerScriptFile($baseUrl . '/lang/' . $this->editorOptions['lang'] . '.js');
     }
     if (isset($this->editorOptions['plugins'])) {
         foreach ($this->editorOptions['plugins'] as $name) {
             $filepath = Yii::getPathOfAlias('booster.assets.redactor.plugins') . '/' . $name . '/' . $name;
             $url = $baseUrl . '/plugins/' . $name . '/' . $name;
             if (file_exists($filepath . '.css')) {
                 $assets->registerCssFile($url . '.css');
             }
             if (file_exists($filepath . '.js')) {
                 $assets->registerScriptFile($url . '.js');
             }
         }
     }
     $options = $this->editorOptions ? CJavaScript::encode($this->editorOptions) : '';
     $assets->registerScript(uniqid(__CLASS__ . '#', true), "jQuery('{$this->selector}').redactor({$options});");
 }
开发者ID:strong2much,项目名称:YiiBooster3,代码行数:27,代码来源:TbRedactorJs.php


示例20: make_booster

 protected function make_booster($id, $set, $user)
 {
     return Booster::make_for_set($set, $id);
 }
开发者ID:4otaku,项目名称:draft,代码行数:4,代码来源:abstract.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Bootstrap类代码示例发布时间:2022-05-23
下一篇:
PHP BoolPropertyItem类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap