PHP Класс Gdn_Dispatcher, vanilla

Наследование: extends Gdn_Pluggable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$ControllerMethod method of the controller to be called.
$ControllerName The name of the controller to be dispatched.

Открытые методы

Метод Описание
__construct ( AddonManager $addonManager = null ) Class constructor.
__get ( string $name ) : mixed Backwards compatible support for deprecated properties.
application ( )
cleanup ( )
controller ( )
controllerArguments ( $Value = null )
controllerMethod ( )
controllerName ( ) Return the properly formatted controller class name.
dispatch ( string | Gdn_Request | null $ImportRequest = null, boolean $Permanent = true ) Dispatch a request to a controller method.
enabledApplication ( $folder = '' ) Returns the name of the enabled application based on $ApplicationFolder.
enabledApplicationFolders ( string $EnabledApplications = '' )
passAsset ( string $AssetName, mixed $Asset ) Allows the passing of a string to the controller's asset collection.
passData ( $Name, $Value )
passProperty ( string $Name, mixed $Mixed ) Allows the passing of any variable to the controller as a property.
reset ( ) Reset the dispatchert to its default state.
start ( )

Приватные методы

Метод Описание
analyzeRequest ( Gdn_Request $request ) Parses the query string looking for supplied request parameters.
createController ( string $controllerName, Gdn_Request $request, &$routeArgs ) : Gdn_Controller Create a controller and initialize it with data from the dispatcher.
dispatchController ( Gdn_Request $request, array $routeArgs ) Dispatch to a controller that's already been found with {@link Gdn_Dispatcher::analyzeRequest()}.
dispatchNotFound ( $reason = 'notfound', $request = null ) * Dispatch a 404 with an event that can be handled.
findController ( array $parts ) : array Find the controller object corresponding to a request path.
findControllerMethod ( Gdn_Controller $controller, string[] $pathArgs ) : array Find the method to call on a controller, based on a path.
getCanBlock ( Gdn_Request $request ) : integer Figure out what kind of blocks are allowed for dispatches.
getEnabledApplicationFolders ( ) : array Get the enabled application folders.
methodExists ( string | Gdn_Controller $object, string $method ) : boolean Check to see if a controller has a method.
parseDeliveryMethod ( string[] $parts ) : array Parse the delivery method base on the file extension.
requestVal ( string $key, array $get, array $post, mixed $default = null ) : mixed A helper function to search through the get/post for a key.
rewriteRequest ( Gdn_Request $request ) Rewrite the request based on rewrite rules (currently called routes in Vanilla).

Описание методов

__construct() публичный Метод

Class constructor.
public __construct ( AddonManager $addonManager = null )
$addonManager Vanilla\AddonManager

__get() публичный Метод

Backwards compatible support for deprecated properties.
public __get ( string $name ) : mixed
$name string The name of the property to get.
Результат mixed Returns the property value.

application() публичный Метод

public application ( )

cleanup() публичный Метод

public cleanup ( )

controller() публичный Метод

public controller ( )

controllerArguments() публичный Метод

public controllerArguments ( $Value = null )

controllerMethod() публичный Метод

public controllerMethod ( )

controllerName() публичный Метод

Return the properly formatted controller class name.
public controllerName ( )

dispatch() публичный Метод

This method analyzes a request and figures out which controller and method it maps to. It also instantiates the controller and calls the method.
public dispatch ( string | Gdn_Request | null $ImportRequest = null, boolean $Permanent = true )
$ImportRequest string | Gdn_Request | null The request to dispatch. This can be a string URL or a Gdn_Request object,
$Permanent boolean Whether or not to set {@link Gdn::request()} with the dispatched request.

enabledApplication() публичный Метод

Returns the name of the enabled application based on $ApplicationFolder.
public enabledApplication ( $folder = '' )

enabledApplicationFolders() публичный Метод

Устаревший:
public enabledApplicationFolders ( string $EnabledApplications = '' )
$EnabledApplications string

passAsset() публичный Метод

Allows the passing of a string to the controller's asset collection.
public passAsset ( string $AssetName, mixed $Asset )
$AssetName string The name of the asset collection to add the string to.
$Asset mixed The string asset to be added. The asset can be one of two things. - string: The string will be rendered to the page. - Gdn_IModule: The Gdn_IModule::Render() method will be called when the asset is rendered.

passData() публичный Метод

public passData ( $Name, $Value )
$Name
$Value

passProperty() публичный Метод

Allows the passing of any variable to the controller as a property.
public passProperty ( string $Name, mixed $Mixed )
$Name string The name of the property to assign the variable to.
$Mixed mixed The variable to be passed as a property of the controller.

reset() публичный Метод

Reset the dispatchert to its default state.
public reset ( )

start() публичный Метод

public start ( )

Описание свойств

$ControllerMethod публичное свойство

method of the controller to be called.
public $ControllerMethod

$ControllerName публичное свойство

The name of the controller to be dispatched.
public $ControllerName