get::helper PHP Method

helper() public static method

Returns a helper object
public static helper ( $helper ) : object
return object
    public static function helper($helper)
    {
        if (is_array($helper)) {
            array_walk($helper, array('self', __METHOD__));
            return;
        }
        if (!isset(self::$config['helpers']) || !in_array($helper, self::$config['helpers'])) {
            self::$config['helpers'][] = $helper;
        }
        return self::_loadObject('helper', $helper);
    }

Usage Example

Esempio n. 1
0
File: get.php Progetto: Borvik/Munla
 /**
  * Gets an instance of each of the helpers for the specified type.
  * 
  * @param string $type The type of helpers to get.
  * @param string|array $skip (repeating) When a string can repeat, else if it's an array must be the last parameter.  The list of helpers to skip.
  * 
  * @return array An array containing all the helpers for the specified type.
  */
 public static function cache_helpers($type)
 {
     $skip = func_get_args();
     array_shift($skip);
     if (count($skip) == 1 && is_array($skip[0])) {
         $skip = $skip[0];
     }
     $ret = array();
     if (isset(config::$defaultHelpers) && is::existset(config::$defaultHelpers, $type)) {
         foreach (config::$defaultHelpers[$type] as $varName => $helperName) {
             if (in_array($helperName, $skip)) {
                 continue;
             }
             $key = is_string($varName) ? $varName : $helperName;
             $ret[$key] = get::helper($helperName);
         }
     }
     return $ret;
 }
All Usage Examples Of get::helper