Stud.IP  6.0
StudipDispatcher Class Reference
Inheritance diagram for StudipDispatcher:
Dispatcher PluginDispatcher

Public Member Functions

 __construct (ContainerInterface $container)
 
 trails_error ($exception)
 
 load_controller ($controller)
 
 getRouteCallable ($uri)
 
- Public Member Functions inherited from Dispatcher
 __construct (string $trails_root, string $trails_uri, string $default_controller)
 
 dispatch ($uri)
 
 map_uri_to_response ($uri)
 
 default_route ()
 
 trails_error ($exception)
 
 clean_request_uri ($uri)
 
 parse ($unconsumed, $controller=null)
 
 split_on_first_slash ($str)
 
 file_exists ($path)
 
 load_controller ($controller)
 
 error_handler ($errno, $string, $file, $line)
 

Protected Attributes

 $container
 

Additional Inherited Members

- Data Fields inherited from Dispatcher
string $trails_root
 
string $trails_uri
 
string $default_controller
 

Detailed Description

Use this subclass to easily get an Stud.IP specific Trails.

Example of use:

// deep in the Stud.IP jungle
$dispatcher->dispatch($requested_uri);

Constructor & Destructor Documentation

◆ __construct()

__construct ( ContainerInterface  $container)

Create a new Trails with Stud.IP specific parameters for: trails_root is "$STUDIP_BASE_PATH/app", trails_uri is "dispatch.php" and default_controller is "default" (which does not map to anything).

Member Function Documentation

◆ getRouteCallable()

getRouteCallable (   $uri)

◆ load_controller()

load_controller (   $controller)

Loads the controller file for a given controller path and return an instance of that controller. If an error occures, an exception will be thrown.

Parameters
string$controllerthe relative controller path
Returns
Trails an instance of that controller
Exceptions

◆ trails_error()

trails_error (   $exception)

Adapted error method that just passes the exception to stud.ip's exception instead of the standard trails handling.

Parameters
Exception$exceptionThe exception that occured
Exceptions
Exception

Field Documentation

◆ $container

$container
protected

The documentation for this class was generated from the following file: