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?>
<?=$this->var?>
will raise a compilation error if the variable is missing
<?=$this->getHref("blog_entry", array("id" => $entry->getId()))?>
Definition at line 51 of file UIViewPresentation.class.php.

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 | |
| UIViewPresentation::__construct | ( | $ | viewName | ) |
| 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().
| UIViewPresentation::__call | ( | $ | name, | |
| array $ | arguments | |||
| ) |
Looks up for the method in the binded UIControl hierarchy, and invokes the first matched one.
| string | $name name of the invoked method | |
| array | $arguments arguments to pass |
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
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.
Definition at line 151 of file UIViewPresentation.class.php.
References Assert::isScalar().
| UIViewPresentation::__set | ( | $ | name, | |
| $ | value | |||
| ) |
A shorthand setter of the model variable.
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] |
Definition at line 96 of file UIPhpLayoutPresentation.class.php.
References Assert::isTrue().
Referenced by UIPhpLayoutPresentation::codeBehind(), renderPartial(), and setMaster().
| UIPhpLayoutPresentation::assertOutsideRenderingContext | ( | ) | [final, protected, inherited] |
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.
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.
| string | $routeName name of the route | |
| array | $parameters parameters to pass to Route's rules |
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.
| string | $href the contents of the tag | |
| string | $routeName name of the route | |
| array | $parameters parameters to pass to Route's rules |
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.
| UIPresentation | $presentation presentation to set; if not specified then the current context will be used |
Definition at line 485 of file UIViewPresentation.class.php.
Referenced by setMaster().
| UIViewPresentation::getModel | ( | ) |
Gets the model passed by the controller.
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.
| UIPresentation | $presentation presentation to set; if not specified then the current context will be used |
Definition at line 469 of file UIViewPresentation.class.php.
| UIViewPresentation::getRouteTable | ( | ) |
Gets the route table used to find the trace to the MVC controller.
Definition at line 292 of file UIViewPresentation.class.php.
| UIViewPresentation::getSelfHref | ( | ) |
Gets the text representastion of the requested URL.
Definition at line 244 of file UIViewPresentation.class.php.
References Assert::isNotEmpty().
| UIViewPresentation::getTrace | ( | ) |
Gets the trace used to invoke the MVC stack.
Definition at line 282 of file UIViewPresentation.class.php.
| UIViewPresentation::getUIControl | ( | ) |
Gets the binded UIControl, if any.
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.
| UIPresentation | $presentation presentation to set; if not specified then the current context will be used |
Definition at line 501 of file UIViewPresentation.class.php.
Referenced by renderPartial().
| UIViewPresentation::render | ( | IOutput $ | output | ) |
Renders the presentation logic to the source.
| IOutput | $output render destination |
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.
| string | $view name of the view to render | |
| Model | $model optional custom model to pass; if not set, the current model will be passed |
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.
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.
| Model | $model |
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.
| IRouteTable | $routeTable |
Definition at line 336 of file UIViewPresentation.class.php.
| UIViewPresentation::setTrace | ( | Trace $ | trace | ) |
Sets the trace used to invoke the MVC stack.
| Trace | $trace |
Definition at line 318 of file UIViewPresentation.class.php.
References Trace::getRouteTable().
| UIViewPresentation::setUIControl | ( | UIControl $ | control | ) |
Sets the binded UIControl.
| UIControl | $control |
Implements IUIControlBindedPresentation.
Definition at line 391 of file UIViewPresentation.class.php.
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.
| const UIViewPresentation::VIEW_EXTENSION = '.view.php' |
Definition at line 55 of file UIViewPresentation.class.php.