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


PHP TbHtml::addCssClass方法代码示例

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


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

示例1: renderField

 /**
  * Renders the input file field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     TbHtml::addCssClass('bfh-selectbox', $this->wrapperOptions);
     echo CHtml::openTag('div', $this->wrapperOptions);
     if ($this->hasModel()) {
         echo CHtml::activeHiddenField($this->model, $this->attribute, $this->htmlOptions);
         $value = $this->model->{$this->attribute};
         $valueText = $value && isset($this->data[$value]) ? $this->data[$value] : ' ';
     } else {
         echo CHtml::hiddenField($name, $this->value, $this->htmlOptions);
         $value = $this->value;
         $valueText = $value && isset($this->data[$value]) ? $this->data[$value] : ' ';
     }
     echo CHtml::openTag('a', array('class' => 'bfh-selectbox-toggle', 'role' => 'button', 'data-toggle' => 'bfh-selectbox', 'href' => '#'));
     echo CHtml::tag('span', array('class' => 'bfh-selectbox-option ' . $this->size, 'data-option' => $value), $valueText);
     echo CHtml::tag('b', array('class' => 'caret'), ' ');
     echo CHtml::closeTag('a');
     echo CHtml::openTag('div', array('class' => 'bfh-selectbox-options'));
     if ($this->displayFilter) {
         echo '<input type="text" class="bfh-selectbox-filter">';
     }
     $items = array();
     foreach ($this->data as $key => $item) {
         $items[] = CHtml::tag('a', array('tabindex' => '-1', 'href' => '#', 'data-option' => $key), $item);
     }
     echo CHtml::tag('ul', array('role' => 'options'), '<li>' . implode('</li><li>', $items) . '</li>');
     echo CHtml::closeTag('div');
     echo CHtml::closeTag('div');
 }
开发者ID:2amigos,项目名称:yiiwheels,代码行数:35,代码来源:WhSelectBox.php

示例2: init

 /**
  * Initializes the widget
  */
 public function init()
 {
     parent::init();
     if (isset($this->itemsCssClass)) {
         TbHtml::addCssClass($this->itemsCssClass, $this->htmlOptions);
     }
 }
开发者ID:AlexanderGrant1,项目名称:AC41004,代码行数:10,代码来源:TbThumbnails.php

示例3: init

 /**
  * Widget's initialization method
  * @throws CException
  */
 public function init()
 {
     $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
     TbHtml::addCssClass('bfh-timepicker', $this->htmlOptions);
     $this->htmlOptions['data-time'] = $this->hasModel() ? $this->model->{$this->attribute} : $this->value;
     $this->inputOptions['readonly'] = true;
 }
开发者ID:2amigos,项目名称:yiiwheels,代码行数:11,代码来源:WhTimePickerHelper.php

示例4: init

 public function init()
 {
     parent::init();
     TbHtml::addCssClass('bfh-phone', $this->htmlOptions);
     $this->htmlOptions['data-format'] = $this->format;
     unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:7,代码来源:WhPhone.php

示例5: init

 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     Yii::import('bootstrap.behaviors.TbWidget');
     $this->attachBehavior('tbWidget', new TbWidget());
     if (!isset($this->assetPath)) {
         $this->assetPath = realpath(dirname(__FILE__) . '/../assets');
     }
     if (!$this->asDropDownList && !isset($this->pluginOptions['data'])) {
         $this->pluginOptions['data'] = $this->normalizeData($this->data);
     }
     if (isset($this->htmlOptions['placeholder'])) {
         if ($this->asDropDownList) {
             $this->htmlOptions['prompt'] = $this->htmlOptions['placeholder'];
         } else {
             $this->pluginOptions['placeholder'] = $this->htmlOptions['placeholder'];
         }
         unset($this->htmlOptions['placeholder']);
     }
     if (!$this->bindPlugin) {
         $this->htmlOptions['data-plugin'] = 'select2';
         $this->htmlOptions['data-plugin-options'] = CJSON::encode($this->pluginOptions);
     }
     if (TbArray::popValue('block', $this->htmlOptions, false)) {
         TbHtml::addCssClass('input-block-level', $this->htmlOptions);
     }
 }
开发者ID:nkovacs,项目名称:yiistrap-select2,代码行数:30,代码来源:TbSelect2.php

示例6: init

 /**
  * Initializes the widget.
  */
 public function init()
 {
     $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
     TbArray::defaultValue('autocomplete', 'off', $this->htmlOptions);
     TbHtml::addCssClass('grd-white', $this->htmlOptions);
     $this->initOptions();
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:10,代码来源:WhDatePicker.php

示例7: run

 /**
  * Renders the widget. If there are no items, nothing will be rendered.
  * TODO: Reuse TbCollapse somehow
  */
 public function run()
 {
     $itemCount = count($this->items);
     if ($itemCount === 0) {
         return;
     }
     echo CHtml::openTag('div', $this->htmlOptions);
     foreach ($this->items as $k => $item) {
         $id = __CLASS__ . '_' . $this->id . '_' . $k;
         $contentId = $id . '_content';
         $linkOptions = array('class' => 'accordion-toggle episode-toggle', 'data-content-id' => $contentId, 'data-toggle' => 'collapse', 'data-parent' => $this->id);
         // Add content-url data attributes to the link when available
         if (isset($item['contentUrl'])) {
             $linkOptions['data-content-url'] = $item['contentUrl'];
         }
         // Render the contents of the heading
         $heading = $this->render('_seasonAccordionHeading', array('linkUrl' => '#' . $id, 'linkOptions' => $linkOptions, 'season' => $item['season']), true);
         $bodyOptions = array('class' => 'accordion-body collapse', 'id' => $id);
         if ($itemCount === 1) {
             TbHtml::addCssClass('in', $bodyOptions);
         }
         echo CHtml::openTag('div', array('class' => 'accordion-group'));
         echo CHtml::tag('div', array('class' => 'accordion-heading'), $heading);
         echo CHtml::openTag('div', $bodyOptions);
         echo CHtml::tag('div', array('id' => $contentId, 'class' => 'accordion-inner'), $item['content']);
         echo CHtml::closeTag('div');
         echo CHtml::closeTag('div');
     }
     echo CHtml::closeTag('div');
 }
开发者ID:pweisenburger,项目名称:xbmc-video-server,代码行数:34,代码来源:SeasonAccordion.php

示例8: init

 /**
  * Widget's initialization method
  * @throws CException
  */
 public function init()
 {
     if (!isset($this->pluginOptions['country'])) {
         throw new CException(Yii::t('zii', '$pluginOptions["country"] cannot be blank.'));
     }
     $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
     TbHtml::addCssClass('bfh-states', $this->htmlOptions);
 }
开发者ID:nicovicz,项目名称:reward-point,代码行数:12,代码来源:WhStates.php

示例9: typeaheadFieldControlGroup

 /**
  * Renders a text field with typeahead functionality based on the specified 
  * data.
  * @param CModel $model the model
  * @param string $attribute the attribute name
  * @param string $data JavaScript-encoded array containing the data for the 
  * typeahead
  * @param array $htmlOptions options to pass to the control group
  * @return string the HTML for the input
  */
 public function typeaheadFieldControlGroup($model, $attribute, $data, $htmlOptions = array())
 {
     // Generate a unique ID for this element
     CHtml::resolveNameID($model, $attribute, $htmlOptions);
     TbHtml::addCssClass('twitter-typeahead-input', $htmlOptions);
     $id = $htmlOptions['id'];
     Yii::app()->clientScript->registerScript($id, "\n\t\t\t\$('#{$id}').typeahead({name: '{$id}',local: {$data},limit: 10});\n\t\t", CClientScript::POS_READY);
     return $this->textFieldControlGroup($model, $attribute, $htmlOptions);
 }
开发者ID:pweisenburger,项目名称:xbmc-video-server,代码行数:19,代码来源:FilterActiveForm.php

示例10: init

 public function init()
 {
     parent::init();
     TbHtml::addCssClass('bfh-fonts', $this->htmlOptions);
     if (!isset($this->htmlOptions['data-font'])) {
         $this->htmlOptions['data-font'] = TbArray::popValue('data-value', $this->htmlOptions);
     }
     unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:9,代码来源:WhFonts.php

示例11: init

 public function init()
 {
     if (empty($this->country) && !isset($this->pluginOptions['country'])) {
         throw new CException('"$country" cannot be empty.');
     }
     $this->pluginOptions['country'] = TbArray::getValue('country', $this->pluginOptions, $this->country);
     parent::init();
     TbHtml::addCssClass('bfh-timezones', $this->htmlOptions);
     unset($this->htmlOptions['data-name']);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:10,代码来源:WhTimezones.php

示例12: init

 /**
  * Initializes the widget
  */
 public function init()
 {
     // Generate a unique ID. We can't rely on the built-in counter in
     // CWidget::getId() because these modals may be rendered from AJAX
     // request and the counter will be zero then
     $this->id = uniqid($this->getId());
     parent::init();
     TbHtml::addCssClass('watch-modal', $this->htmlOptions);
     $this->header = Yii::t('Movies', 'Watch / Download');
 }
开发者ID:pweisenburger,项目名称:xbmc-video-server,代码行数:13,代码来源:WatchMediaModal.php

示例13: renderField

 /**
  * Renders the typeahead field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     TbHtml::addCssClass('form-control', $this->htmlOptions);
     if ($this->hasModel()) {
         echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo CHtml::textField($this->name, $this->value, $this->htmlOptions);
     }
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:15,代码来源:WhTypeAhead.php

示例14: init

 /**
  * Widget's initialization method
  * @throws CException
  */
 public function init()
 {
     $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
     TbHtml::addCssClass('bfh-phone', $this->htmlOptions);
     $this->htmlOptions['data-format'] = $this->format;
     if ($this->readOnly) {
         $this->htmlOptions['data-number'] = $this->hasModel() ? $this->model->{$this->attribute} : $this->value;
     } else {
         $this->pluginOptions['format'] = $this->format;
         $this->pluginOptions['value'] = $this->hasModel() ? $this->model->{$this->attribute} : $this->value;
     }
 }
开发者ID:2amigos,项目名称:yiiwheels,代码行数:16,代码来源:WhPhone.php

示例15: init

 public function init()
 {
     if (empty($this->country)) {
         throw new CException('"$country" cannot be empty.');
     }
     $this->pluginOptions['country'] = $this->country;
     parent::init();
     TbHtml::addCssClass('bfh-states', $this->htmlOptions);
     if (!isset($this->htmlOptions['data-state'])) {
         $this->htmlOptions['data-state'] = TbArray::popValue('data-value', $this->htmlOptions);
     }
     unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:13,代码来源:WhStates.php


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