當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TbArray::merge方法代碼示例

本文整理匯總了PHP中TbArray::merge方法的典型用法代碼示例。如果您正苦於以下問題:PHP TbArray::merge方法的具體用法?PHP TbArray::merge怎麽用?PHP TbArray::merge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TbArray的用法示例。


在下文中一共展示了TbArray::merge方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testMerge

 public function testMerge()
 {
     $a = array('this' => 'is', 'array' => 'a');
     $b = array('is' => 'this', 'b' => 'array');
     $array = TbArray::merge($a, $b);
     $this->assertEquals('is', TbArray::getValue('this', $array));
     $this->assertEquals('a', TbArray::getValue('array', $array));
     $this->assertEquals('this', TbArray::getValue('is', $array));
     $this->assertEquals('array', TbArray::getValue('b', $array));
 }
開發者ID:mfavetti,項目名稱:LimeSurvey,代碼行數:10,代碼來源:TbArrayTest.php

示例2: initOptions

 /**
  * Initializes the plugin options
  */
 public function initOptions()
 {
     $options = array();
     foreach (array('matcher', 'sorter', 'updater', 'highlighter') as $fn) {
         if ($this->{$fn} !== null) {
             if ($this->{$fn} instanceof CJavaScriptExpression) {
                 $options[$fn] = $this->{$fn};
             } else {
                 $options[$fn] = new CJavaScriptExpression($this->{$fn});
             }
         }
     }
     $this->pluginOptions = TbArray::merge(array('source' => $this->source, 'items' => $this->items, 'minLength' => $this->minLength), $options);
 }
開發者ID:nicovicz,項目名稱:reward-point,代碼行數:17,代碼來源:TbTypeAhead.php

示例3: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!$this->hasModel() && $this->name === null) {
         throw new CException("Either 'name', or 'model' and 'attribute' properties must be specified.");
     }
     if (!isset($this->htmlOptions['id'])) {
         $this->htmlOptions['id'] = $this->hasModel() ? CHtml::activeId($this->model, $this->attribute) : $this->getId();
     }
     $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
     $this->htmlOptions = TbArray::merge($this->asDataAttributes($this->pluginOptions), $this->htmlOptions);
     $this->pluginOptions = false;
     if ($this->hasModel()) {
         $this->htmlOptions['data-name'] = CHtml::activeId($this->model, $this->attribute);
         $this->htmlOptions['data-value'] = CHtml::value($this->model, $this->attribute);
     } else {
         $this->htmlOptions['data-name'] = $this->name;
         $this->htmlOptions['data-value'] = $this->value;
     }
 }
開發者ID:mfavetti,項目名稱:LimeSurvey,代碼行數:23,代碼來源:WhInputWidget.php

示例4: medias

 /**
  * Generates multiple media objects.
  * @param array $items item configurations.
  * @param string $tag the item tag name.
  * @return string generated objects.
  */
 public static function medias(array $items, $tag = 'div')
 {
     if (!empty($items)) {
         $output = '';
         foreach ($items as $itemOptions) {
             if (isset($itemOptions['visible']) && $itemOptions['visible'] === false) {
                 continue;
             }
             // todo: consider removing the support for htmlOptions.
             $options = TbArray::popValue('htmlOptions', $itemOptions, array());
             if (!empty($options)) {
                 $itemOptions = TbArray::merge($options, $itemOptions);
             }
             $image = TbArray::popValue('image', $itemOptions);
             $heading = TbArray::popValue('heading', $itemOptions, '');
             $content = TbArray::popValue('content', $itemOptions, '');
             TbArray::defaultValue('tag', $tag, $itemOptions);
             $output .= self::media($image, $heading, $content, $itemOptions);
         }
         return $output;
     }
     return '';
 }
開發者ID:juankie,項目名稱:gestcb9git,代碼行數:29,代碼來源:TbHtml.php


注:本文中的TbArray::merge方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。