Class View
Base class for views with integrated support for data encoders, a shared proxy view, automated renderer delegation and chained translator instance.
Proxy views are generalised views that do not render a specific page but
provide a shared output buffer and common methods that request-specific
views utilise to render a page. Proxy views are implemented as view drivers
and commonly implement some sort of template system.
For better IDE integration regarding application-specific extensions to the
proxy view, all views should derive from base view class defined by the
application and document a magic proxy property with the class of the
configured proxy view.
- Core\Object implements Core\Chainable
- Core\Set implements Core\Accessor
- Core\Set\Mutable implements Core\Mutator
- Core\Field implements Core\Inquiry
- Core\Field\Mutable implements Core\Variator
- Core\View
Direct known subclasses
Core\View\Driver\html
,
Core\View\Driver\plain
,
Core\View\Driver\yui
Indirect known subclasses
Package: Core\MVC\View
Since: 3.0
Requires: PHP 5.3
Version: 1.3
Located at View.inc.php
Methods summary
public
|
|
public static
|
|
public static
|
#
derive( $proxyKey, $viewClass )
Initialises and returns a new view instance with a chained proxy view instance retrieved from the global registry. |
public
boolean
|
#
chain(
Sets a new proxy view or translation instance. Existing entries are overwritten. |
public
|
#
clear( )
Resets the internal rendering buffer, if possible. Used to clear partly rendered outputs if rendering was stopped before completion, for example due to an exception. |
public
string
|
|
public
|
#
encoder( )
Returns a reference to the associated encoder instance. If the view does not yet retain an encoder instance, either the encoder from its proxy view is retained or, if the view itself is a proxy or it is used standalone, a new encoder instance is automatically created from the URI string encoder parameter. |
public
boolean
|
|
public
|
|
public
|
#
uri( string|array $controller = null, string $action = null, array $parameters = null )
Returns reference to new URI instance for the URL returned by a call to
|
public
string
|
#
url( string|array $controller = null, string $action = null, array $parameters = null )
Formats URL string using the currently active query interface of the primary controller for a given MVC target. |
Methods inherited from Core\Field\Mutable
offsetSet()
,
offsetUnset()
,
setDataForKey()
,
setDataForKeys()
,
setKeyMasquerade()
,
updateMasqueradedKeys()
Methods inherited from Core\Field
getDataForKey()
,
getDataForKeys()
,
getDataForUndefinedKey()
,
issetDataForKey()
,
offsetExists()
,
offsetGet()
Methods inherited from Core\Set\Mutable
Methods inherited from Core\Object
__autocreateFactory()
,
__call()
,
__processParameters()
,
__toString()
,
attachMethod()
,
getValueForKey()
,
getValueForKeyPath()
,
getValueForUndefinedKey()
,
hash()
,
issetValueForKey()
,
setValueForKey()
,
setValueForKeyPath()
,
setValueForUndefinedKey()
,
uuid()
Constants summary
string |
EncoderParameter
Parameter name of encoder URI string to automatically create an encoder instance for data encoding. |
#
'encoder'
|
Constants inherited from Core\Object
AnyParameterType
,
AutochainParameterType
,
AutocreateParameterType
,
BooleanParameterType
,
CharParameterType
,
EnumParameterType
,
IntegerParameterType
,
RealParameterType
,
StringParameterType
,
UserParameterType
Properties summary
protected
array
|
$_v_parameters
KVC property. |
|
protected
|
$_v_proxy
KVC property. |
|
protected
|
$_v_renderers
KVC property. |
|
protected
|
$_v_translator
KVC property. |
|
protected
|
$_v_uri
KVC property. |
|
protected
|
$_encoder
Encoder instance used by the view. This value is unset and equals
|
Properties inherited from Core\Field\Mutable
Properties inherited from Core\Field
Magic properties
public read-only
|
$encoder
See |
public read-only
array
|
$parameters
Hash of initialisation parameters extracted from the driver URI for proxy views. |
public read-only
|
$proxy
Reference to shared proxy view. |
public read-only
|
$renderers
Array of renderer function names. This property can be set by controllers to automatically run a specified set of renderer methods once the view is rendered. A controller can add a renderer name by simply appending to this array, as shown in the following example: |
public read-only
|
$translator
Reference to chained translator instance or |
public read-only
|
$uri
Proxy URI. Stored by proxy views to apply parameters to normal views. |