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


PHP TbArray::defaultValue方法代码示例

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


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

示例1: init

 /**
  * Widget's initialization method
  */
 public function init()
 {
     $this->attachBehavior('TbWidget', new TbWidget());
     $this->copyId();
     TbArray::defaultValue('placement', $this->placement, $this->htmlOptions);
     $this->initEvents();
 }
开发者ID:nicovicz,项目名称:reward-point,代码行数:10,代码来源:TbTabs.php

示例2: 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

示例3: 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);
        echo CHtml::openTag('div', $this->htmlOptions);
        echo CHtml::openTag('div', array('class' => 'input-prepend bfh-timepicker-toggle', 'data-toggle' => 'bfh-timepicker'));
        echo CHtml::tag('span', array('class' => 'add-on'), TbHtml::icon(TbHtml::ICON_TIME));
        if ($this->hasModel()) {
            echo CHtml::activeTextField($this->model, $this->attribute, $this->inputOptions);
        } else {
            echo CHtml::textField($name, $this->value, $this->inputOptions);
        }
        echo CHtml::closeTag('div');
        echo '<div class="bfh-timepicker-popover">
				<table class="table">
				<tbody>
					<tr>
						<td class="hour">
						<a class="next" href="#"><i class="icon-chevron-up"></i></a><br>
						<input type="text" class="input-mini" readonly><br>
						<a class="previous" href="#"><i class="icon-chevron-down"></i></a>
						</td>
						<td class="separator">:</td>
						<td class="minute">
						<a class="next" href="#"><i class="icon-chevron-up"></i></a><br>
						<input type="text" class="input-mini" readonly><br>
						<a class="previous" href="#"><i class="icon-chevron-down"></i></a>
						</td>
					</tr>
				</tbody>
				</table>
			</div>';
        echo CHtml::closeTag('div');
    }
开发者ID:2amigos,项目名称:yiiwheels,代码行数:38,代码来源:WhTimePickerHelper.php

示例4: init

 /**
  * Initializes the widget.
  */
 public function init()
 {
     $this->attachBehavior('TbWidget', new TbWidget());
     $this->copyId();
     if (isset($this->size)) {
         TbArray::defaultValue('size', $this->size, $this->htmlOptions);
     }
 }
开发者ID:LumbaJack,项目名称:Mercado-BTX,代码行数:11,代码来源:TbPager.php

示例5: testDefaultValue

 public function testDefaultValue()
 {
     $array = array();
     TbArray::defaultValue('key', 'default', $array);
     $this->assertEquals('default', TbArray::getValue('key', $array));
     TbArray::defaultValue('key', 'value', $array);
     $this->assertEquals('default', TbArray::getValue('key', $array));
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:8,代码来源:TbArrayTest.php

示例6: renderField

 /**
  * Renders the select2 field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     if ($this->hasModel()) {
         echo $this->asDropDownList ? TbHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions) : TbHtml::activeHiddenField($this->model, $this->attribute);
     } else {
         echo $this->asDropDownList ? TbHtml::dropDownList($this->name, $this->value, $this->data, $this->htmlOptions) : TbHtml::hiddenField($this->name, $this->value);
     }
 }
开发者ID:branJakJak,项目名称:goawtodayaldiskon,代码行数:14,代码来源:WhSelect2.php

示例7: renderField

 /**
  * Renders field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     if ($this->hasModel()) {
         echo CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo CHtml::textArea($name, $this->value, $this->htmlOptions);
     }
 }
开发者ID:nicovicz,项目名称:reward-point,代码行数:14,代码来源:WhRedactor.php

示例8: 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);
     $this->htmlOptions['data-url'] = $this->uploadAction;
     $this->pluginOptions['url'] = $this->uploadAction;
     if ($this->hasModel()) {
         echo CHtml::activeFileField($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo CHtml::fileField($name, $this->value, $this->htmlOptions);
     }
 }
开发者ID:nicovicz,项目名称:reward-point,代码行数:16,代码来源:WhBasicFileUpload.php

示例9: init

 /**
  * Initializes the widget.
  */
 public function init()
 {
     TbArray::defaultValue('successClass', 'success', $this->pluginOptions);
     TbArray::defaultValue('errorClass', 'error', $this->pluginOptions);
     if (!isset($this->assetPath)) {
         $this->assetPath = Yii::getPathOfAlias('vendor.guillaumepotier.parsleyjs.dist');
     }
     if (!$this->bindPlugin) {
         $this->htmlOptions['data-plugin'] = 'parsley';
         $this->htmlOptions['data-plugin-options'] = CJSON::encode($this->pluginOptions);
     }
     parent::init();
 }
开发者ID:nordsoftware,项目名称:yii-parsley,代码行数:16,代码来源:ParsleyActiveForm.php

示例10: renderField

 /**
  * Renders the field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     echo '<span class="bootstrap-timepicker">';
     if ($this->hasModel()) {
         echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo CHtml::textField($name, $this->value, $this->htmlOptions, array('style' => 'width:100%'));
     }
     echo '</span>';
 }
开发者ID:nicovicz,项目名称:reward-point,代码行数:16,代码来源:WhTimePicker.php

示例11: renderField

 /**
  * Renders the multiselect field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     // fixes #32: 'multiple' will be forced later in jQuery plugin
     $this->htmlOptions['multiple'] = 'multiple';
     if ($this->hasModel()) {
         echo CHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);
     } else {
         echo CHtml::dropDownList($this->name, $this->value, $this->data, $this->htmlOptions);
     }
 }
开发者ID:2amigos,项目名称:yiiwheels,代码行数:16,代码来源:WhMultiSelect.php

示例12: renderField

 /**
  * Renders the field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     echo '<div class="input-group">';
     echo '<div class="input-group-addon"><span class="glyphicon glyphicon-time"></span></div>';
     if ($this->hasModel()) {
         echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo CHtml::textField($name, $this->value, $this->htmlOptions, array('style' => 'width:100%'));
     }
     echo '</div>';
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:17,代码来源:WhTimePicker.php

示例13: init

 /**
  * Initializes the widget.
  */
 public function init()
 {
     if ($this->brandLabel !== false) {
         if (!isset($this->brandLabel)) {
             $this->brandLabel = CHtml::encode(Yii::app()->name);
         }
         if (!isset($this->brandUrl)) {
             $this->brandUrl = Yii::app()->homeUrl;
         }
     }
     if (isset($this->color)) {
         TbArray::defaultValue('color', $this->color, $this->htmlOptions);
     }
     if (isset($this->display) && $this->display !== TbHtml::NAVBAR_DISPLAY_NONE) {
         TbArray::defaultValue('display', $this->display, $this->htmlOptions);
     }
 }
开发者ID:AlexanderGrant1,项目名称:AC41004,代码行数:20,代码来源:TbNavbar.php

示例14: renderField

 /**
  * Renders field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     $tagOptions = $this->htmlOptions;
     $tagOptions['id'] = 'aceEditor_' . $tagOptions['id'];
     echo CHtml::openTag('div', $tagOptions);
     echo CHtml::closeTag('div');
     $this->htmlOptions['style'] = 'display:none';
     if ($this->hasModel()) {
         echo CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo CHtml::textArea($name, $this->value, $this->htmlOptions);
     }
     $this->htmlOptions = $tagOptions;
 }
开发者ID:optimosolution,项目名称:jasorbd,代码行数:20,代码来源:WhAceEditor.php

示例15: 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);
     if ($this->useHelperSelectBox) {
         $select = Yii::createComponent(CMap::mergeArray($this->helperOptions, array('class' => 'yiiwheels.widgets.formhelpers.WhSelectBox', 'htmlOptions' => $this->htmlOptions, 'model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'wrapperOptions' => array('class' => 'bfh-fonts', 'data-family' => $this->hasModel() ? $this->model->{$this->attribute} : $this->value))));
         $select->init();
         $select->run();
     } else {
         $this->htmlOptions['data-family'] = $this->hasModel() ? $this->model->{$this->attribute} : $this->value;
         if ($this->hasModel()) {
             echo CHtml::activeDropDownList($this->model, $this->attribute, array(), $this->htmlOptions);
         } else {
             echo CHtml::dropDownList($name, $this->value, array(), $this->htmlOptions);
         }
     }
 }
开发者ID:2amigos,项目名称:yiiwheels,代码行数:21,代码来源:WhFonts.php


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