Skip to content

Latest commit

 

History

History
512 lines (211 loc) · 6.13 KB

frontcontroller.md

File metadata and controls

512 lines (211 loc) · 6.13 KB
title footer
\leantime\core\frontcontroller
false

frontcontroller

  • Full name: \leantime\core\frontcontroller

Methods

__construct

__construct - Set the rootpath of the server

private frontcontroller::__construct( $rootPath, \leantime\core\IncomingRequest $incomingRequest): mixed

Parameters:

Parameter Type Description
rootPath ****
incomingRequest \leantime\core\IncomingRequest

Return Value:


getInstance

getInstance - just one instance of the object is allowed (it makes no sense to have more)

public static frontcontroller::getInstance( $rootPath = null, \leantime\core\IncomingRequest $incomingRequest = null): object
  • This method is static.

Parameters:

Parameter Type Description
rootPath ****
incomingRequest \leantime\core\IncomingRequest

Return Value:

(instance)


dispatch

run - executes the action depending on Request or firstAction

public static frontcontroller::dispatch(mixed $action = '', mixed $httpResponseCode = 200): void
  • This method is static.

Parameters:

Parameter Type Description
action mixed
httpResponseCode mixed

Return Value:


executeAction

executeAction - includes the class in includes/modules by the Request

private static frontcontroller::executeAction(string $completeName, mixed $params = array()): void
  • This method is static.

Parameters:

Parameter Type Description
completeName string actionname.filename
params mixed

Return Value:


getRequestMethod

private static frontcontroller::getRequestMethod(): mixed
  • This method is static.

Return Value:


getRequestParams

private static frontcontroller::getRequestParams(mixed $method): mixed
  • This method is static.

Parameters:

Parameter Type Description
method mixed

Return Value:


includeAction

includeAction - possible to include action from everywhere

public static frontcontroller::includeAction( $completeName, mixed $params = array()): void
  • This method is static.

Parameters:

Parameter Type Description
completeName ****
params mixed

Return Value:


getActionName

getActionName - split string to get actionName

public static frontcontroller::getActionName( $completeName): string
  • This method is static.

Parameters:

Parameter Type Description
completeName ****

Return Value:


getModuleName

getModuleName - split string to get modulename

public static frontcontroller::getModuleName( $completeName): string
  • This method is static.

Parameters:

Parameter Type Description
completeName ****

Return Value:


getCurrentRoute

getCurrentRoute - gets the current main action

public static frontcontroller::getCurrentRoute(): string
  • This method is static.

Return Value:


redirect

public static frontcontroller::redirect(mixed $url, mixed $http_response_code = 303): void
  • This method is static.

Parameters:

Parameter Type Description
url mixed
http_response_code mixed

Return Value:


setResponseCode

public static frontcontroller::setResponseCode(mixed $responseCode): mixed
  • This method is static.

Parameters:

Parameter Type Description
responseCode mixed

Return Value:


Inherited methods

dispatch_event

dispatches an event with context

public static eventhelpers::dispatch_event(string $hook, mixed $available_params = [], string|int $function = null): void
  • This method is static.

Parameters:

Parameter Type Description
hook string
available_params mixed
function **string int**

Return Value:


dispatch_filter

dispatches a filter with context

public static eventhelpers::dispatch_filter(string $hook, mixed $payload, mixed $available_params = [], string|int $function = null): mixed
  • This method is static.

Parameters:

Parameter Type Description
hook string
payload mixed
available_params mixed
function **string int**

Return Value:


get_event_context

Gets the context of the event

private static eventhelpers::get_event_context(mixed $function): string
  • This method is static.

Parameters:

Parameter Type Description
function mixed

Return Value:


set_class_context

Gets the class context based on path, this uses the same method as the autoloader Helps create unique strings for events/filters

private static eventhelpers::set_class_context(): string
  • This method is static.

Return Value:


get_function_context

Gets the caller function name

private static eventhelpers::get_function_context(mixed $functionInt = null): string

This way we don't have to use much memory by using debug_backtrace

  • This method is static.

Parameters:

Parameter Type Description
functionInt mixed

Return Value:



Automatically generated from source code comments on 2023-02-28 using phpDocumentor