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


PHP ObjectCollection::normalizeObjectArray方法代码示例

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


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

示例1: changeEditor

 /**
  * Changes the editor on the fly
  *
  * @param string $editor String name of editor, excluding the word 'Helper'
  * @return void
  * @author Jose Diaz-Gonzalez
  **/
 public function changeEditor($editor)
 {
     $this->helper = ucfirst($editor);
     $prefix = '';
     if ($editor !== 'Form') {
         $prefix = 'Wysiwyg.';
     }
     if (!$this->importedHelpers[$this->helper]) {
         $this->importedHelpers[$this->helper] = true;
         $this->helpers[] = $prefix . $this->helper;
         $this->_helperMap = ObjectCollection::normalizeObjectArray($this->helpers);
     }
 }
开发者ID:rchavik,项目名称:cakephp-wysiwyg-helper,代码行数:20,代码来源:WysiwygHelper.php

示例2: __construct

 /**
  * Default Constructor
  *
  * @param View $View The View this helper is being attached to.
  * @param array $settings Configuration settings for the helper.
  */
 public function __construct(View $View, $settings = array())
 {
     $this->_View = $View;
     $this->request = $View->request;
     if (!empty($this->helpers)) {
         $this->_helperMap = ObjectCollection::normalizeObjectArray($this->helpers);
     }
 }
开发者ID:ndreynolds,项目名称:arcs,代码行数:14,代码来源:Helper.php

示例3: testnormalizeObjectArray

 /**
  * test normalizeObjectArray
  *
  * @return void
  */
 public function testnormalizeObjectArray()
 {
     $components = array('Html', 'Foo.Bar' => array('one', 'two'), 'Something', 'Banana.Apple' => array('foo' => 'bar'));
     $result = ObjectCollection::normalizeObjectArray($components);
     $expected = array('Html' => array('class' => 'Html', 'settings' => array()), 'Bar' => array('class' => 'Foo.Bar', 'settings' => array('one', 'two')), 'Something' => array('class' => 'Something', 'settings' => array()), 'Apple' => array('class' => 'Banana.Apple', 'settings' => array('foo' => 'bar')));
     $this->assertEquals($expected, $result);
     // This is the result after Controller::_mergeVars
     $components = array('Html' => null, 'Foo.Bar' => array('one', 'two'), 'Something' => null, 'Banana.Apple' => array('foo' => 'bar'));
     $result = ObjectCollection::normalizeObjectArray($components);
     $this->assertEquals($expected, $result);
 }
开发者ID:ndreynolds,项目名称:arcs,代码行数:16,代码来源:ObjectCollectionTest.php

示例4: changeEditor

 /**
  * Changes the editor on the fly
  *
  * @param string $editor String name of editor, excluding the word 'Helper'
  * @param array $helperOptions Each type of wysiwyg helper takes different options.
  * @return void
  * @throws MissingHelperException
  **/
 public function changeEditor($editor, $helperOptions = array())
 {
     $this->helper = ucfirst($editor);
     if (!empty($helperOptions)) {
         $this->updateSettings($helperOptions);
     }
     if (!isset($this->importedHelpers[$this->helper])) {
         throw new MissingHelperException(sprintf("Missing Wysiwyg.%s Helper", $this->helper));
     }
     if (!$this->importedHelpers[$this->helper]) {
         $class = 'Wysiwyg.' . $this->helper;
         $helpers = ObjectCollection::normalizeObjectArray(array($class));
         foreach ($helpers as $properties) {
             list($plugin, $class) = pluginSplit($properties['class']);
             $this->{$class} = $this->_View->Helpers->load($properties['class'], $properties['settings']);
         }
         $this->importedHelpers[$this->helper] = true;
     }
 }
开发者ID:anujjaha,项目名称:angels,代码行数:27,代码来源:WysiwygHelper.php


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