Example #1
0
 /**
  * include the given class and return always the same instance
  *
  * @param string $selector the jelix selector correponding to the class
  * @return object an instance of the classe
  */
 public static function getService($selector)
 {
     $sel = new Selector\ClassSelector($selector);
     $s = $sel->toString();
     if (isset(self::$_instances[$s])) {
         return self::$_instances[$s];
     } else {
         $o = self::create($selector);
         self::$_instances[$s] = $o;
         return $o;
     }
 }