\Dewdrop\Admin\PageFactoryFiles

This factory finds page files in your admin component's folder.

Summary

Methods
Properties
Constants
__construct()
setPath()
getPath()
setComponentNamespace()
getComponentNamespace()
createPage()
listAvailablePages()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$inflector
$path
$componentNamespace
N/A

Properties

$inflector

$inflector : \Dewdrop\Inflector

The inflector used to convert between URL style ("page-name") pages to file names ("PageName").

Type

\Dewdrop\Inflector

$path

$path : string

The path where we'll look for files.

Type

string

$componentNamespace

$componentNamespace : string

The namespace of the component that will be used when instantiating pages.

Type

string

Methods

setPath()

setPath(string  $path) : $this

Set the path used when looking for page files.

Parameters

string $path

Returns

$this

getPath()

getPath() : string

Get the path used when looking for page files.

Returns

string

setComponentNamespace()

setComponentNamespace(string  $componentNamespace) : $this

Override the component namepsace that will be used when instantiating pages.

Parameters

string $componentNamespace

Returns

$this

getComponentNamespace()

getComponentNamespace() : string

Get the namespace of the component so that we can determine the appropriate class name for pages we're instantiating.

Returns

string

createPage()

createPage(string  $name) : \Dewdrop\Admin\Page\PageAbstract|false

Instantiate the page, if it exists in the component's folder. Otherwise, return false so that other factories can attempt to satisfy the request.

Note that we deliberately skip requests for "component" because that will be the component class file, not a page.

Parameters

string $name

Returns

\Dewdrop\Admin\Page\PageAbstract|false

listAvailablePages()

listAvailablePages() : array

Iterate over the PHP files available in the component's folder to list all the page this factory is capable of serving. Note that we skip "component", which is the component class, not a page.

Returns

array