Skip to content
Artem Khitsenko edited this page Jan 30, 2021 · 2 revisions

Class: Controller

Namespace: Afoslt\Core

Parent: -

Modifiers: abstract

Base class for all controllers in application.


Methods

ClassName (?string $controllerShortClassName): ?string

Modifiers: public static final

Gets a short version of class and returns full name based on current manifest settings.

Controller keyword and keyword using can be change in application's manifest.

Examples:

  • With keyword for controllers: Controller

Input: Examples\Example

Output: Afoslt\Controllers\Examples\ExampleController

  • With keyword for controllers: Test

Input: Index

Output: Afoslt\Controllers\IndexTest

Returns full name of a class. For null will return null.

Exists (?string $controllerName): ?string

Modifiers: public static final

Check if controller exists.

MethodExists (?string $methodName): bool

Modifiers: public final

Checks if controller have method with specific name.

Returns true if controller have method. For null will return false.

MethodExists (?string $methodName): bool

Modifiers: public final

Checks if controller have method with specific name.

ActionExists (?string $actionName): bool

Modifiers: public final

Checks if controller have action with specific name. Difference between this method and MethodExists that this method will add keywords if manifest told so, also action could be only public.

Returns true if controller have action.For null will always return false.

ActionName (?string $actionShortName): ?string

Modifiers: public final static

Gets a short version of action of controller and returns full name based on current manifest settings. Action's keyword and keyword using can be change in application's manifest.

Examples:

  • With keyword for actions: Action

Input: Example

Output: ExampleAction

  • With keyword for controllers: Handler

Input: OnRegister

Output: OnRegisterHandler

Returns full name of an action. For null will returns null.

Clone this wiki locally