Home  Support  API

UIViewPresentation Class Reference
[Presentation]


Represents an extended version of presentation engine which is binded with UIControl objects and MVC stack and provides various features of it with the protected methods.

Helper methods return strings, that are not appended to the output!

See:

Hints:

        <?=$this->var?>

will raise a compilation error if the variable is missing

Definition at line 51 of file UIViewPresentation.class.php.

Inheritance diagram for UIViewPresentation:
Inheritance graph

List of all members.

Public Attributes

const VIEW_EXTENSION = '.view.php'

Public Member Functions

 __call ($name, array $arguments)
 Looks up for the method in the binded UIControl hierarchy, and invokes the first matched one.
 __construct ($viewName)
 __get ($name)
 A shorthand getter of the model variables.
 __isset ($name)
 A shorthand check whether the variable is defined within the model.
 __set ($name, $value)
 A shorthand setter of the model variable.
 getHref ($routeName, array $parameters=array())
 Gets the string representation of the URL constructed via the named Route that is defined within IRouteTable.
 getHtmlLink ($href, $routeName, array $parameters=array())
 Gets the text representation of the HTML tag.
 getModel ()
 Gets the model passed by the controller.
 getRouteTable ()
 Gets the route table used to find the trace to the MVC controller.
 getSelfHref ()
 Gets the text representastion of the requested URL.
 getTrace ()
 Gets the trace used to invoke the MVC stack.
 getUIControl ()
 Gets the binded UIControl, if any.
 render (IOutput $output)
 Renders the presentation logic to the source.
 setModel (Model $model)
 Sets the controller's model.
 setRouteTable (IRouteTable $routeTable)
 Sets the route table used to find the trace to the MVC controller.
 setTrace (Trace $trace)
 Sets the trace used to invoke the MVC stack.
 setUIControl (UIControl $control)
 Sets the binded UIControl.

Protected Member Functions

 accept ()
 assertInsideRenderingContext ()
 assertOutsideRenderingContext ()
 codeBehind ($type)
 Wrapper over ASP.NET-like "CodeBehind" and "Inherits" attributes.
 expect ()
 getMasterPage (UIPresentation $presentation=null)
 Creates an instance of (a custom) UIMasterPage with UIPresentation inside.
 getPage (UIPresentation $presentation=null)
 Creates an instance of (a custom) UIPage with UIPresentation inside.
 getUserControl (UIPresentation $presentation=null)
 Creates an instance of (a custom) UIUserControl with UIPresentation inside.
 renderPartial ($view, Model $model=null)
 In-place render of a separate UIControl.
 setMaster ($view, Model $model=null)
 Sets the master control.

Protected Attributes

 $control
 $model
 $routeTable
 $trace

Constructor & Destructor Documentation

UIViewPresentation::__construct ( viewName  ) 
Parameters:
string $viewName name of the view located at $app_dir/views/<viewName>.view.php

Reimplemented from UIPhpLayoutPresentation.

Definition at line 92 of file UIViewPresentation.class.php.

References Assert::isScalar().


Member Function Documentation

UIViewPresentation::__call ( name,
array $  arguments 
)

Looks up for the method in the binded UIControl hierarchy, and invokes the first matched one.

Parameters:
string $name name of the invoked method
array $arguments arguments to pass
Returns:
mixed

Definition at line 167 of file UIViewPresentation.class.php.

References Assert::isUnreachable().

UIViewPresentation::__get ( name  ) 

A shorthand getter of the model variables.

If the variable is missing, and error_reporting is turned off (by prepending the call with the "@" operator) then the variable is treated as NULL. Otherwise a compilation error is raised

Returns:
mixed

Definition at line 126 of file UIViewPresentation.class.php.

References Assert::isScalar(), and Assert::isUnreachable().

UIViewPresentation::__isset ( name  ) 

A shorthand check whether the variable is defined within the model.

Returns:
boolean

Definition at line 151 of file UIViewPresentation.class.php.

References Assert::isScalar().

UIViewPresentation::__set ( name,
value 
)

A shorthand setter of the model variable.

Returns:
void

Definition at line 110 of file UIViewPresentation.class.php.

References Assert::isScalar().

UIViewPresentation::accept (  )  [protected]

Definition at line 371 of file UIViewPresentation.class.php.

UIPhpLayoutPresentation::assertInsideRenderingContext (  )  [final, protected, inherited]
Returns:
void

Definition at line 96 of file UIPhpLayoutPresentation.class.php.

References Assert::isTrue().

Referenced by UIPhpLayoutPresentation::codeBehind(), renderPartial(), and setMaster().

UIPhpLayoutPresentation::assertOutsideRenderingContext (  )  [final, protected, inherited]
Returns:
void

Definition at line 104 of file UIPhpLayoutPresentation.class.php.

References Assert::isFalse().

Referenced by UIPhpLayoutPresentation::render().

UIPhpLayoutPresentation::codeBehind ( type  )  [final, protected, inherited]

Wrapper over ASP.NET-like "CodeBehind" and "Inherits" attributes.

Returns:
void

Definition at line 82 of file UIPhpLayoutPresentation.class.php.

References UIPhpLayoutPresentation::assertInsideRenderingContext(), TypeUtils::isChild(), and Assert::isTrue().

UIViewPresentation::expect (  )  [protected]

Definition at line 351 of file UIViewPresentation.class.php.

References Assert::isTrue().

UIViewPresentation::getHref ( routeName,
array $  parameters = array() 
)

Gets the string representation of the URL constructed via the named Route that is defined within IRouteTable.

Table is hold by the Trace.

Parameters:
string $routeName name of the route
array $parameters parameters to pass to Route's rules
Returns:
string

Definition at line 190 of file UIViewPresentation.class.php.

References Assert::isNotEmpty().

Referenced by getHtmlLink().

UIViewPresentation::getHtmlLink ( href,
routeName,
array $  parameters = array() 
)

Gets the text representation of the HTML tag.

URL is constructed via the named Route that is defined within IRouteTable.

Parameters:
string $href the contents of the tag
string $routeName name of the route
array $parameters parameters to pass to Route's rules
Returns:
string

Definition at line 229 of file UIViewPresentation.class.php.

References getHref().

UIViewPresentation::getMasterPage ( UIPresentation presentation = null  )  [protected]

Creates an instance of (a custom) UIMasterPage with UIPresentation inside.

Parameters:
UIPresentation $presentation presentation to set; if not specified then the current context will be used
Returns:
UIMasterPage

Definition at line 485 of file UIViewPresentation.class.php.

Referenced by setMaster().

UIViewPresentation::getModel (  ) 

Gets the model passed by the controller.

Returns:
Model|null

Definition at line 272 of file UIViewPresentation.class.php.

UIViewPresentation::getPage ( UIPresentation presentation = null  )  [protected]

Creates an instance of (a custom) UIPage with UIPresentation inside.

Parameters:
UIPresentation $presentation presentation to set; if not specified then the current context will be used
Returns:
UIPage

Definition at line 469 of file UIViewPresentation.class.php.

UIViewPresentation::getRouteTable (  ) 

Gets the route table used to find the trace to the MVC controller.

Returns:
IRouteTable|null

Definition at line 292 of file UIViewPresentation.class.php.

UIViewPresentation::getSelfHref (  ) 

Gets the text representastion of the requested URL.

Returns:
string

Definition at line 244 of file UIViewPresentation.class.php.

References Assert::isNotEmpty().

UIViewPresentation::getTrace (  ) 

Gets the trace used to invoke the MVC stack.

Returns:
Trace|null

Definition at line 282 of file UIViewPresentation.class.php.

UIViewPresentation::getUIControl (  ) 

Gets the binded UIControl, if any.

Returns:
UIControl|null

Implements IUIControlBindedPresentation.

Definition at line 398 of file UIViewPresentation.class.php.

UIViewPresentation::getUserControl ( UIPresentation presentation = null  )  [protected]

Creates an instance of (a custom) UIUserControl with UIPresentation inside.

Parameters:
UIPresentation $presentation presentation to set; if not specified then the current context will be used
Returns:
UIUserControl

Definition at line 501 of file UIViewPresentation.class.php.

Referenced by renderPartial().

UIViewPresentation::render ( IOutput output  ) 

Renders the presentation logic to the source.

Parameters:
IOutput $output render destination
Returns:
void

Reimplemented from UIPhpLayoutPresentation.

Definition at line 382 of file UIViewPresentation.class.php.

UIViewPresentation::renderPartial ( view,
Model model = null 
) [protected]

In-place render of a separate UIControl.

Parameters:
string $view name of the view to render
Model $model optional custom model to pass; if not set, the current model will be passed
Returns:
void

Definition at line 411 of file UIViewPresentation.class.php.

References $model, UIPhpLayoutPresentation::assertInsideRenderingContext(), getUserControl(), and UIControl::render().

UIViewPresentation::setMaster ( view,
Model model = null 
) [protected]

Sets the master control.

Returns:
void

Definition at line 441 of file UIViewPresentation.class.php.

References $model, UIPhpLayoutPresentation::assertInsideRenderingContext(), getMasterPage(), and Assert::isTrue().

UIViewPresentation::setModel ( Model model  ) 

Sets the controller's model.

Parameters:
Model $model
Returns:
UIViewPresentation

Definition at line 304 of file UIViewPresentation.class.php.

UIViewPresentation::setRouteTable ( IRouteTable routeTable  ) 

Sets the route table used to find the trace to the MVC controller.

Parameters:
IRouteTable $routeTable
Returns:
UIViewPresentation

Definition at line 336 of file UIViewPresentation.class.php.

UIViewPresentation::setTrace ( Trace trace  ) 

Sets the trace used to invoke the MVC stack.

Parameters:
Trace $trace
Returns:
UIViewPresentation

Definition at line 318 of file UIViewPresentation.class.php.

References Trace::getRouteTable().

UIViewPresentation::setUIControl ( UIControl control  ) 

Sets the binded UIControl.

Parameters:
UIControl $control
Returns:
IUIControlBindedPresentation itself

Implements IUIControlBindedPresentation.

Definition at line 391 of file UIViewPresentation.class.php.


Member Data Documentation

UIViewPresentation::$control [protected]

Definition at line 60 of file UIViewPresentation.class.php.

UIViewPresentation::$model [protected]

Definition at line 65 of file UIViewPresentation.class.php.

Referenced by renderPartial(), and setMaster().

UIViewPresentation::$routeTable [protected]

Definition at line 75 of file UIViewPresentation.class.php.

UIViewPresentation::$trace [protected]

Definition at line 70 of file UIViewPresentation.class.php.

Definition at line 55 of file UIViewPresentation.class.php.


The documentation for this class was generated from the following file: