public static function loadHelper($helperName, $dirs = null)
    {
        if (isset(self::$loadedHelpers[$helperName])) {
            return;
        }
        
        self::fireEvent('Atomik::Loadhelper::Before', array(&$helperName, &$dirs));
        $functionName = $helperName;
        $camelizedHelperName = str_replace(' ', '', ucwords(str_replace('_', ' ', $helperName)));
        $className = $camelizedHelperName . 'Helper';
        
        if (!function_exists($functionName) && !class_exists($className)) {
            $dirs = self::path($dirs ?: self::get('atomik.dirs.helpers'));
            if (($include = self::findFile("$helperName.php", $dirs, true)) === false) {
                throw new AtomikException("Helper '$helperName' not found");
            }
            list($filename, $ns) = $include;
            include $filename;
            $functionName = ltrim("$ns\\$functionName", '\\');
            $className = ltrim("$ns\\$className", '\\');
        }
        
        if (function_exists($functionName)) {
            self::$loadedHelpers[$helperName] = $functionName;
        } else if (class_exists($className, false)) {
            self::$loadedHelpers[$helperName] = array(new $className(), $camelizedHelperName);
        } else {
            throw new AtomikException("Helper '$helperName' file found but no function or class matching the helper name");
        }
        
        self::fireEvent('Atomik::Loadhelper::After', array($helperName, $dirs));
    }
public static function loadHelper($helperName, $dirs = null)
    {
        if (isset(self::$loadedHelpers[$helperName])) {
            return;
        }
        
        self::fireEvent('Atomik::Loadhelper::Before', array(&$helperName, &$dirs));
        $functionName = $helperName;
        $camelizedHelperName = str_replace(' ', '', ucwords(str_replace('_', ' ', $helperName)));
        $className = $camelizedHelperName . 'Helper';
        
        if (!function_exists($functionName) && !class_exists($className)) {
            $dirs = self::path($dirs ?: self::get('atomik.dirs.helpers'));
            if (($include = self::findFile("$helperName.php", $dirs, true)) === false) {
                throw new AtomikException("Helper '$helperName' not found");
            }
            list($filename, $ns) = $include;
            include $filename;
            $functionName = ltrim("$ns\\$functionName", '\\');
            $className = ltrim("$ns\\$className", '\\');
        }
        
        if (function_exists($functionName)) {
            self::$loadedHelpers[$helperName] = $functionName;
        } else if (class_exists($className, false)) {
            self::$loadedHelpers[$helperName] = array(new $className(), $camelizedHelperName);
        } else {
            throw new AtomikException("Helper '$helperName' file found but no function or class matching the helper name");
        }
        
        self::fireEvent('Atomik::Loadhelper::After', array($helperName, $dirs));
    }
public static function loadHelper ( $ helperName , $ dirs = null ) { if ( isset ( self :: $ loadedHelpers [ $ helperName ] ) ) { return ; } self :: fireEvent ( 'Atomik::Loadhelper::Before' , array ( & $ helperName , & $ dirs ) ) ; $ functionName = $ helperName ; $ camelizedHelperName = str_replace ( ' ' , '' , ucwords ( str_replace ( '_' , ' ' , $ helperName ) ) ) ; $ className = $ camelizedHelperName . 'Helper' ; if ( ! function_exists ( $ functionName ) && ! class_exists ( $ className ) ) { $ dirs = self :: path ( $ dirs ? : self :: get ( 'atomik.dirs.helpers' ) ) ; if ( ( $ include = self :: findFile ( "$helperName.php" , $ dirs , true ) ) === false ) { throw new AtomikException ( "Helper '$helperName' not found" ) ; } list ( $ filename , $ ns ) = $ include ; include $ filename ; $ functionName = ltrim ( "$ns\\$functionName" , '\\' ) ; $ className = ltrim ( "$ns\\$className" , '\\' ) ; } if ( function_exists ( $ functionName ) ) { self :: $ loadedHelpers [ $ helperName ] = $ functionName ; } else if ( class_exists ( $ className , false ) ) { self :: $ loadedHelpers [ $ helperName ] = array ( new $ className ( ) , $ camelizedHelperName ) ; } else { throw new AtomikException ( "Helper '$helperName' file found but no function or class matching the helper name" ) ; } self :: fireEvent ( 'Atomik::Loadhelper::After' , array ( $ helperName , $ dirs ) ) ; }
Loads an helper file

@param string $helperName
@param array $dirs Directories where to search for helpers
Loads an helper file