PHP 클래스 Elgg\Router

Plugin devs should use these wrapper functions: * elgg_register_page_handler * elgg_unregister_page_handler
부터: 1.9.0
파일 보기 프로젝트 열기: elgg/elgg 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( PluginHooksService $hooks ) Constructor
allowRewrite ( Request $request ) : Request Filter a request through the route:rewrite hook
getPageHandlers ( ) : array Get page handlers as array of identifier => callback
registerPageHandler ( string $identifier, string $function ) : boolean Register a function that gets called when the first part of a URL is equal to the identifier.
route ( Request $request ) : boolean Routes the request to a registered page handler
unregisterPageHandler ( string $identifier ) : void Unregister a page handler for an identifier

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( PluginHooksService $hooks )
$hooks PluginHooksService For customized routing.

allowRewrite() 공개 메소드

Filter a request through the route:rewrite hook
public allowRewrite ( Request $request ) : Request
$request Elgg\Http\Request Elgg request
리턴 Elgg\Http\Request

getPageHandlers() 공개 메소드

Get page handlers as array of identifier => callback
public getPageHandlers ( ) : array
리턴 array

registerPageHandler() 공개 메소드

Register a function that gets called when the first part of a URL is equal to the identifier.
public registerPageHandler ( string $identifier, string $function ) : boolean
$identifier string The page type to handle
$function string Your function name
리턴 boolean Depending on success

route() 공개 메소드

This function triggers a plugin hook 'route', $identifier so that plugins can modify the routing or handle a request.
public route ( Request $request ) : boolean
$request Elgg\Http\Request The request to handle.
리턴 boolean Whether the request was routed successfully.

unregisterPageHandler() 공개 메소드

Unregister a page handler for an identifier
public unregisterPageHandler ( string $identifier ) : void
$identifier string The page type identifier
리턴 void