Gdn::dispatcher PHP Method

dispatcher() public static method

Gets the global dispatcher object.
public static dispatcher ( ) : Gdn_Dispatcher
return Gdn_Dispatcher
    public static function dispatcher()
    {
        return self::factory(self::AliasDispatcher);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  *
  *
  * @param $SliceName
  * @param array $Arguments
  * @return Gdn_Slice
  */
 public function slice($SliceName, $Arguments = array())
 {
     $CurrentPath = Gdn::request()->path();
     $ExplodedPath = explode('/', $CurrentPath);
     switch ($this instanceof Gdn_IPlugin) {
         case true:
             $ReplacementIndex = 2;
             break;
         case false:
             $ReplacementIndex = 1;
             break;
     }
     if ($ExplodedPath[0] == strtolower(Gdn::dispatcher()->application()) && $ExplodedPath[1] == strtolower(Gdn::dispatcher()->controller())) {
         $ReplacementIndex++;
     }
     $ExplodedPath[$ReplacementIndex] = $SliceName;
     $SlicePath = implode('/', $ExplodedPath);
     return Gdn::Slice($SlicePath);
 }
All Usage Examples Of Gdn::dispatcher