\Dewdrop\Admin\EnvEnvInterface

This interface has to be implemented by an environment wanting to run Dewdrop admin components. So far, we've only attempted to support WP and Silex, but it should be possible for other environments to drive components if they implement this interface.

Summary

Methods
Constants
registerComponentsInPath()
registerComponentFolder()
registerComponent()
renderLayout()
url()
initComponent()
getComponent()
redirect()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

registerComponentsInPath()

registerComponentsInPath(string  $path = null) : \Dewdrop\Admin\Env\EnvInterface

Register all the components that can be found in the specified path.

If no path is given, we'll use the getAdmin() method from \Dewdrop\Paths.

Parameters

string $path

Returns

\Dewdrop\Admin\Env\EnvInterface

registerComponentFolder()

registerComponentFolder(string  $folder, string  $classPrefix) : \Dewdrop\Admin\Env\EnvInterface

Register the component located in the specified folder. We expect a Component.php file to be located in the folder that is a sub-class of \Dewdrop\Admin\Component\ComponentAbstract.

Parameters

string $folder
string $classPrefix

Returns

\Dewdrop\Admin\Env\EnvInterface

renderLayout()

renderLayout(string  $content, \Zend\View\Helper\HeadScript  $headScript = null, \Zend\View\Helper\HeadLink  $headLink = null) : string

Render the layout for the response. A layout should wrap the page-specific content. The HeadScript helper is also provided from the page's view so that its contents can be integrated with the environment.

Parameters

string $content
\Zend\View\Helper\HeadScript $headScript
\Zend\View\Helper\HeadLink $headLink

Returns

string

url()

url(\Dewdrop\Admin\Component\ComponentInterface  $component, string  $page, array  $params = array()) : string

Return a URL that will work to route the user to the specified page in your environment. The URLs may vary quite a lot depending upon the environment.

Parameters

\Dewdrop\Admin\Component\ComponentInterface $component
string $page
array $params

Returns

string

initComponent()

initComponent(\Dewdrop\Admin\Component\ComponentInterface  $component) : void

Initialize the component, setting up any needed routes, event handlers, etc. for the environment.

Parameters

\Dewdrop\Admin\Component\ComponentInterface $component

redirect()

redirect(string  $url) : mixed

Perform a redirect to the supplied URL using whatever method is preferred by the current environment.

Parameters

string $url

Returns

mixed