This is the external interface of the whole framework.
Embed Nethgui Framework into any application by instantiating this
class, invoking the setter methods and catching the output from the dispatch()
method.
Methods summary
public
|
|
public
Nethgui\Framework
|
#
registerNamespace( string $namespacePath )
Add a namespace to the framework, where to search for Modules.
Add a namespace to the framework, where to search for Modules.
Declare that the given namespace is a Nethgui extension. It must have a "Module"
subpackage.
For instance, an "Acme" namespace should have the following directory/package structure
- Acme - Module - Template - Language - Help
Note: classes and interfaces from a registered namespace are autoloaded.
Parameters
- $namespacePath
- The absolute path to the namespace root directory
Returns
See
autoloader()
Api
|
public
Nethgui\Framework
|
#
setSiteUrl( string $siteUrl )
The web site URL without trailing slash
The web site URL without trailing slash
Parameters
Returns
Example
http://www.example.org:8080
Api
|
public
Nethgui\Framework
|
#
setBasePath( type $basePath )
The path component of an URL with a leading and trailing slash.
The path component of an URL with a leading and trailing slash.
An empty path collapse to a single slash "/".
Parameters
Returns
Example
/my/path/to/the/app/
Api
|
public
Nethgui\Framework
|
#
setDefaultModule( string $moduleIdentifier )
Redirect to the given module if the original request
does not specify any module.
Redirect to the given module if the original request
does not specify any module.
Parameters
Returns
Api
|
public
Nethgui\Framework
|
#
setForcedLoginModule( type $moduleIdentifier )
Forcibly redirect to the given module after successful login
Forcibly redirect to the given module after successful login
Parameters
Returns
Api
|
public
Nethgui\Framework
|
#
setSessionSetupProcedure( Closure $f )
Install a call back function that retrieves the session setup parameters
during the login() procedure. The function receives as first argument
the dependency container object (Pimple\Container) and must return
an associative array with session setup parameters. Allowed values are
Install a call back function that retrieves the session setup parameters
during the login() procedure. The function receives as first argument
the dependency container object (Pimple\Container) and must return
an associative array with session setup parameters. Allowed values are
- MaxSessionIdleTime (int)
- MaxSessionLifeTime (int)
Parameters
Returns
Api
|
public
Nethgui\Framework
|
#
setAuthenticationValidator( Closure $closure )
Configure the login procedure used to authenticate a user in Login module.
Configure the login procedure used to authenticate a user in Login module.
The $closure argument must return an object implementing ValidatorInterface.
Its evaluate() method accepts one array argument with three elements:
- username (string)
- password (string)
- credentials (reference to array)
Additional login informations can be stored into the
"credentials" hash, which will be accessible from through the UserInterface
Parameters
Returns
See
|
public
Nethgui\Framework
|
#
setDecoratorTemplate( string|callable $template )
The script or function that decorates the current module output
The script or function that decorates the current module output
Parameters
Returns
Api
|
public
Nethgui\Framework
|
#
setLogLevel( integer $level )
Change the level of details in the log output
Change the level of details in the log output
Parameters
- $level
- The standard PHP error mask
Returns
Api
|
public
string
|
#
absoluteScriptPath( string $symbol )
Translate a namespaced classifier (interface, class) or a namespaced-script-name
into an absolute filesystem path.
Translate a namespaced classifier (interface, class) or a namespaced-script-name
into an absolute filesystem path.
This is equivalent to the autoloader() function
Parameters
- $symbol
- A "namespace" classifier or script file name
Returns
string The absolute script path of $symbol
Example
Nethgui\Template\Help is converted into /abs/path/Nethgui/Template/Help.php
|
public
integer
|
#
dispatch( Nethgui\Controller\RequestInterface $request, array & $output = NULL )
Forwards control to Modules and creates output views.
Forwards control to Modules and creates output views.
This is the framework "main()" function / entry point.
Parameters
- $request
- $output
- DEPRECATED since 1.6
Returns
integer DEPRECATED since 1.6
Api
|
public
Nethgui\View\ViewInterface
|
|
public
Nethgui\Controller\Request
|
#
createRequest( integer $type = NULL )
Create a default Request object for dispatch()
Create a default Request object for dispatch()
Parameters
Returns
Nethgui\Controller\Request
See
Api
|
public
void;
|
|