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

  • AbstractRenderer
  • Json
  • ReadonlyView
  • TemplateRenderer
  • Xhtml

Interfaces

  • WidgetFactoryInterface
  • WidgetInterface
  • Overview
  • Namespace
  • Class
  • Deprecated

Class ReadonlyView

Boilerplate stuff to disable write access operations of a view.

Nethgui\Renderer\ReadonlyView implements Nethgui\View\ViewInterface, Nethgui\Log\LogConsumerInterface

Direct known subclasses

Nethgui\Renderer\AbstractRenderer

Indirect known subclasses

Nethgui\Module\Help\Renderer, Nethgui\Renderer\Json, Nethgui\Renderer\TemplateRenderer, Nethgui\Renderer\Xhtml, Nethgui\Widget\Xhtml\ElementRenderer
Namespace: Nethgui\Renderer
Author: Davide Principi davide.principi@nethesis.it
Since: 1.0
Located at Renderer/ReadonlyView.php
Methods summary
public
# __construct( Nethgui\View\ViewInterface $view )
public ViewInterface
# copyFrom( Traversable $data )

Assign data to the View state.

Assign data to the View state.

Parameters

$data

Returns

ViewInterface

Api

Implementation of

Nethgui\View\ViewInterface::copyFrom()
public
# getIterator( )

Implementation of

IteratorAggregate::getIterator()
public Nethgui\Module\ModuleInterface
# getModule( )

The module associated to this view.

The module associated to this view.

Returns

Nethgui\Module\ModuleInterface

Api

Implementation of

Nethgui\View\ViewInterface::getModule()
public
# offsetExists( $offset )

Implementation of

ArrayAccess::offsetExists()
public
# offsetGet( $offset )

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( $offset, $value )

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( $offset )

Implementation of

ArrayAccess::offsetUnset()
public ViewInterface
# setTemplate( string|callable|boolean $template )

Set the template to be applied to the view

Set the template to be applied to the view

  • If a string is given, it identifies a PHP Template script (ie. Nethgui\Template\Main);

  • If a callback function is given, it is invoked with an array representing the view state as argument and is expected to return a string representing the view;

  • If a boolean FALSE, is given the view is rendered as an empty string.

Parameters

$template
The template converting the view state to a string

Returns

ViewInterface

Api

Implementation of

Nethgui\View\ViewInterface::setTemplate()
public string|callable|boolean
# getTemplate( )

TODO

TODO

Returns

string|callable|boolean

See

Nethgui\Renderer\ReadonlyView::setTemplate()

Api

Implementation of

Nethgui\View\ViewInterface::getTemplate()
public Nethgui\View\ViewInterface
# spawnView( Nethgui\Module\ModuleInterface $module, boolean $register = FALSE )

Create a new view object associated to $module

Create a new view object associated to $module

Parameters

$module
The associated $module
$register
If TRUE the returned view is added to the current object with key equal to the module identifier

Returns

Nethgui\View\ViewInterface
The new view object, of the same type of the actual.

Api

Implementation of

Nethgui\View\ViewInterface::spawnView()
public string
# translate( string $message, array $args = array() )

A method to translate a message according to the user language preferences.

A method to translate a message according to the user language preferences.

Parameters

$message
$value
$args

Returns

string

See

TranslatorInterface::translate()
Nethgui\Renderer\ReadonlyView::getTranslator()

Api

Implementation of

Nethgui\View\ViewInterface::translate()
public Nethgui\View\TranslatorInterface
# getTranslator( )

Access to the object performing string translations

Access to the object performing string translations

Returns

Nethgui\View\TranslatorInterface

See

Nethgui\Renderer\ReadonlyView::translate()

Api

Implementation of

Nethgui\View\ViewInterface::getTranslator()
public array
# getModulePath( )

Gets the array of the current module identifier plus all identifiers of the ancestor modules, starting from the root.

Gets the array of the current module identifier plus all identifiers of the ancestor modules, starting from the root.

Returns

array

See

ModuleInterface::getParent()
ModuleInterface::getIdentifier()

Api

Implementation of

Nethgui\View\ViewInterface::getModulePath()
public string
# getUniqueId( string $parts = '' )

Generate a unique identifier for the given $path. If no parts are given the identifier refers the the module referenced by the view.

Generate a unique identifier for the given $path. If no parts are given the identifier refers the the module referenced by the view.

Parameters

$parts
$path Relative to the current module

Returns

string

Api

Implementation of

Nethgui\View\ViewInterface::getUniqueId()
public string
# getClientEventTarget( string $name )

Get the target control identifier for the given view member

Get the target control identifier for the given view member

Parameters

$name

Returns

string

See

358


Api

Implementation of

Nethgui\View\ViewInterface::getClientEventTarget()
public string
# getModuleUrl( string $path = '' )

Return an absolute url path.

Return an absolute url path.

Parameters

$path
Relative to the current module

Returns

string

See

Nethgui\Renderer\ReadonlyView::resolvePath()

Api

Implementation of

Nethgui\View\ViewInterface::getModuleUrl()
public Nethgui\Log\LogConsumerInterface
# setLog( Nethgui\Log\LogInterface $log )

Change the log attached to the interface implementor

Change the log attached to the interface implementor

Parameters

$log

Returns

Nethgui\Log\LogConsumerInterface

Api

Implementation of

Nethgui\Log\LogConsumerInterface::setLog()
public Nethgui\Log\LogInterface
# getLog( )

The log attached to the interface implementor

The log attached to the interface implementor

Returns

Nethgui\Log\LogInterface

Api

Implementation of

Nethgui\Log\LogConsumerInterface::getLog()
public array
# resolvePath( string $path )

Obtain the complete path list, starting from root.

Obtain the complete path list, starting from root.

An heading '/' character treat the $path as absolute, otherwise the $path is considered relative to the current module and a '..' substring goes one level up.

Parameters

$path
The path

Returns

array
The path parts, starting from root

See

Nethgui\Renderer\ReadonlyView::getModulePath()
Nethgui\Renderer\ReadonlyView::getModule()

Api

Implementation of

Nethgui\View\ViewInterface::resolvePath()
public string
# getPathUrl( )

The path component of an URL with a leading slash and trailing

The path component of an URL with a leading slash and trailing

Returns

string

Example

/my/path/to/the/app/

Api

Implementation of

Nethgui\View\ViewInterface::getPathUrl()
public string
# getSiteUrl( )

The web site URL without trailing slash

The web site URL without trailing slash

Returns

string

Example

http://www.example.org:8080

Api

Implementation of

Nethgui\View\ViewInterface::getSiteUrl()
public string
# getTargetFormat( )

Get the requested resource format

Get the requested resource format

Deprecated

since 1.6

Returns

string

Api

Implementation of

Nethgui\View\ViewInterface::getTargetFormat()
public Nethgui\View\LegacyCommandBag
# getCommandList( string $selector = '' )

Get a command list for the given selector

Get a command list for the given selector

The returned command list is ready to execute().

NOTE: only view objects correctly deliver commands to the client-side. Widget commands are delivered to widget objects and executed server-side only.

Deprecated

since version 1.6

Parameters

$selector
Routes the command list to the receiver appointed by this parameter.

Returns

Nethgui\View\LegacyCommandBag

Api

Implementation of

Nethgui\View\ViewInterface::getCommandList()
public boolean
# hasCommandList( $selector = '' )

Check if one or more commands has been added to the selected command list

Check if one or more commands has been added to the selected command list

Deprecated

since version 1.6

Returns

boolean
TRUE, if some command has been added to the list

Api

Implementation of

Nethgui\View\ViewInterface::hasCommandList()
Constants inherited from Nethgui\View\ViewInterface
TARGET_JSON, TARGET_XHTML
Properties summary
protected Nethgui\View\ViewInterface $view
#
Nethgui Framework API documentation generated by ApiGen