本文整理汇总了PHP中Bootstrap::getBooster方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::getBooster方法的具体用法?PHP Bootstrap::getBooster怎么用?PHP Bootstrap::getBooster使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::getBooster方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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 = Bootstrap::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;
}
}
示例2: 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 = Bootstrap::getBooster();
if ($sort->resolveAttribute($this->name) !== false) {
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();
}
}
}
示例3: registerClientScript
/**
* Register required script files
*
* @param integer $id
*/
public function registerClientScript($id)
{
$booster = Bootstrap::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);
}
示例4: init
/**
*
*/
public function init()
{
Bootstrap::getBooster()->registerPackage('ui-layout');
if (!is_array($this->options)) {
$this->options = array();
}
if (!is_array($this->htmlOptions)) {
$this->htmlOptions = array();
}
}
示例5: init
/**
*### .init()
*
* Initializes the widget.
*/
public function init()
{
parent::init();
$booster = Bootstrap::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;
}
}
示例6: registerClientScript
/**
*### .registerClientScript()
*
* Registers required
*
* @param string $id
*/
public function registerClientScript($id)
{
Bootstrap::getBooster()->registerAssetJs('bootstrap.colorpicker.js', CClientScript::POS_HEAD);
Bootstrap::getBooster()->registerAssetCss('bootstrap-colorpicker.css');
$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() . ';');
}
示例7: registerLanguageScript
public function registerLanguageScript()
{
if (isset($this->options['language']) && $this->options['language'] != 'en') {
$file = 'locales/bootstrap-datetimepicker.' . $this->options['language'] . '.js';
$booster = Bootstrap::getBooster();
if (@file_exists(Yii::getPathOfAlias('bootstrap.assets.bootstrap-datetimepicker') . '/js/' . $file)) {
if ($booster->enableCdn) {
// Not in CDN yet
$booster->registerAssetJs('../bootstrap-datetimepicker/' . '/js/' . $file);
} else {
$booster->registerAssetJs('../bootstrap-datetimepicker/' . '/js/' . $file);
}
}
}
}
示例8: registerClientScript
/**
* Publishes and registers the necessary script files.
*/
protected function registerClientScript()
{
$assets = Bootstrap::getBooster()->assetsRegistry;
$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});");
}
示例9: registerClientScript
/**
* Registers required css and js files
*
* @param integer $id the id of the toggle button
*/
protected function registerClientScript($id)
{
$booster = Bootstrap::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() . ';');
}
示例10: init
public function init()
{
$booster = Bootstrap::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));
}
示例11: registerClientScript
/**
* Registers required
*
* @param integer $id
*/
public function registerClientScript($id)
{
$booster = Bootstrap::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});");
}
}
示例12: registerClientScript
/**
* Publishes and registers the necessary script files.
*/
protected function registerClientScript()
{
$assets = Bootstrap::getBooster()->assetsRegistry;
$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});");
if ($this->showDisableLegendsButton && !empty($this->disableLegendsButtonSelector)) {
$assets->registerScript(__CLASS__ . '#' . $this->getId() . '_disableLegendsButton', "\$('{$this->disableLegendsButtonSelector}').on('click', function() {\n var series = highchart{$this->getId()}.series;\n for(var i = 0; i < series.length; i++) {\n \$(series[i].legendItem.element).trigger('click');\n }\n });");
}
}
示例13: registerClientScript
/**
* Register required script files
*/
public function registerClientScript()
{
$assets = Bootstrap::getBooster()->assetsRegistry;
$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('bootstrap.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});");
}
示例14: registerClientScript
/**
* Registers required css and js files
*
* @param integer $id the id of the toggle button
*/
protected function registerClientScript($id)
{
$cs = Yii::app()->clientScript;
$cs->registerCoreScript('jquery');
$booster = Bootstrap::getBooster();
$booster->registerAssetCss('bootstrap-toggle-buttons.css');
$booster->registerAssetJs('jquery.toggle.buttons.js');
$config = CJavaScript::encode($this->getConfiguration());
$cs->registerScript(__CLASS__ . '#' . $this->getId(), "\$('#wrapper-{$id}').toggleButtons({$config});");
}
示例15: registerClientScript
/**
*### .registerClientScript()
*
* Registers required script files (CSS in this case)
*/
public function registerClientScript()
{
Bootstrap::getBooster()->registerAssetCss('bootstrap-box.css');
}