Library::getClassName PHP Method

getClassName() static public method

static public getClassName ( $fullName )
    static function getClassName($fullName)
    {
        if (isset(self::$classesByFull[$fullName])) {
            return self::$classesByFull[$fullName];
        }
        $lastDotPosition = strrpos($fullName, self::dotSeparator);
        if ($lastDotPosition === false) {
            self::$classesByFull[$fullName] = $fullName;
            return $fullName;
        } else {
            $className = substr($fullName, $lastDotPosition + 1);
            self::$classesByFull[$fullName] = $className;
            return $className;
        }
    }

Usage Example

 /**
  * Import and (as required) initialize helpers for use in the view.
  * Helper is the path and name of a class as used by Library::import().
  * For multiple helpers, pass a single array of helpers or use multiple arguments.
  * 
  * @param $helper
  */
 public function loadHelper($helper)
 {
     $helpers = is_array($helper) ? $helper : func_get_args();
     foreach ($helpers as $helper) {
         Library::import($helper);
         $init = array(Library::getClassName($helper), 'init');
         if (is_callable($init)) {
             call_user_func($init, $this);
         }
     }
 }
All Usage Examples Of Library::getClassName