Overview

Namespaces

  • Nethgui
    • Adapter
    • Authorization
    • Component
    • Controller
      • Collection
      • Table
    • Exception
    • Log
    • Model
    • Module
      • Help
      • Notification
    • Renderer
    • Serializer
    • System
    • Test
      • Tool
      • Unit
        • Nethgui
          • Adapter
            • ParameterSet
          • Authorization
          • Log
          • Module
            • Notification
          • Renderer
          • Serializer
          • System
          • Utility
          • View
        • Test
          • Tool
    • Utility
    • View
    • Widget
      • Xhtml
  • None
  • Test
    • Tool

Classes

  • Framework

Functions

  • array_end
  • array_head
  • array_rest
  • Overview
  • Namespace
  • Class
  • Deprecated

Class Framework

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.

Namespace: Nethgui
See:

dispatch(Controller\RequestInterface $request)


Api
Located at Framework.php
Methods summary
public
# __construct( )
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

Nethgui\Framework

See

autoloader()

Api

public Nethgui\Framework
# setSiteUrl( string $siteUrl )

The web site URL without trailing slash

The web site URL without trailing slash

Parameters

$siteUrl

Returns

Nethgui\Framework

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

$basePath

Returns

Nethgui\Framework

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

$moduleIdentifier

Returns

Nethgui\Framework

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

$moduleIdentifier

Returns

Nethgui\Framework

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

$f

Returns

Nethgui\Framework

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

$closure

Returns

Nethgui\Framework

See

Nethgui\Authorization\UserInterface
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

$template

Returns

Nethgui\Framework

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

Nethgui\Framework

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
# handle( Nethgui\Controller\RequestInterface $request )

Parameters

$request

Returns

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

$type
  • Not used

Returns

Nethgui\Controller\Request

See

Nethgui\Framework::dispatch()

Api

public void;
# printHttpException( Nethgui\Exception\HttpException $ex, $backtrace = TRUE )

Send a plain text formatted string as server-response.

Send a plain text formatted string as server-response.

Parameters

$ex
$backtrace

Returns

void;

Api

Nethgui Framework API documentation generated by ApiGen