class PresenterFactory implements IPresenterFactory

Default presenter loader.

Methods

__construct(callable|null $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.

setAliases(array $aliases)

Sets pairs [alias => destination]

string
getAlias(string $alias)

Returns the destination registered under the given alias, or throws if not found.

Details

at line 38
__construct(callable|null $factory = null)

No description

Parameters

callable|null $factory

at line 49
IPresenter createPresenter(string $name)

Creates new presenter instance.

Parameters

string $name

Return Value

IPresenter

at line 60
string getPresenterClass(string $name)

Generates and checks presenter class name.

Parameters

string $name

Return Value

string

Exceptions

InvalidPresenterException

at line 87
PresenterFactory setMapping(array $mapping)

Sets mapping as pairs [module => mask]

Parameters

array $mapping

Return Value

PresenterFactory

at line 111
string formatPresenterClass(string $presenter)

internal  
 

Formats presenter class name from its name.

Parameters

string $presenter

Return Value

string

at line 133
PresenterFactory setAliases(array $aliases)

Sets pairs [alias => destination]

Parameters

array $aliases

Return Value

PresenterFactory

at line 143
string getAlias(string $alias)

Returns the destination registered under the given alias, or throws if not found.

Parameters

string $alias

Return Value

string