class PresenterFactory implements IPresenterFactory

Default presenter loader.

Traits

Strict class for better experience.

Methods

__construct(callable $factory = null)

No description

createPresenter(string $name)

Creates new presenter instance.

string
getPresenterClass(string $name)

Generates and checks presenter class name.

setMapping(array $mapping)

Sets mapping as pairs [module => mask]

string
formatPresenterClass(string $presenter)

Formats presenter class name from its name.

string|null
unformatPresenterClass(string $class)

Formats presenter name from class name.

Details

at line 38
__construct(callable $factory = null)

Parameters

callable $factory function (string $class): IPresenter

at line 47
IPresenter createPresenter(string $name)

Creates new presenter instance.

Parameters

string $name

Return Value

IPresenter

at line 57
string getPresenterClass(string $name)

Generates and checks presenter class name.

Parameters

string $name

Return Value

string

Exceptions

InvalidPresenterException

at line 96
PresenterFactory setMapping(array $mapping)

Sets mapping as pairs [module => mask]

Parameters

array $mapping

Return Value

PresenterFactory

at line 118
string formatPresenterClass(string $presenter)

Formats presenter class name from its name.

Parameters

string $presenter

Return Value

string

at line 136
string|null unformatPresenterClass(string $class)

Formats presenter name from class name.

Parameters

string $class

Return Value

string|null