$_view
$_view : \Horde_View
The parent view invoking the helper.
Capture lets you extract parts of code which can be used in other points of the template or even layout file.
All helpers hold a link back to the instance of the view. The undefined property handlers (get()/call() methods) are used to mix helpers together, effectively placing them on the same pane of glass (the view) and allowing any helper to call any other.
$_view : \Horde_View
The parent view invoking the helper.
__construct(\Horde_View $view)
Creates a helper for $view.
\Horde_View | $view | The view to help. |
capture() : \Horde_View_Helper_Capture_Base
Capture allows you to extract a part of the template into an instance variable.
You can use this instance variable anywhere in your templates and even in your layout. Example:
<?php $capture = $this->capture() ?>
Welcome To my shiny new web page!
<?php $this->greeting = $capture->end() ?>
contentFor(string $name) : \Horde_View_Helper_Capture_ContentFor
Calling contentFor() stores the block of markup for later use.
Subsequently, you can retrieve it inside an instance variable that will be named "contentForName" in another template or in the layout. Example:
<?php $capture = $this->contentFor("header") ?>
<?php $capture->end() ?>
// Use $this->contentForHeader anywhere in your templates: <?php echo $this->contentForHeader ?>
string | $name | Name of the content that becomes the instance variable name. "foo" -> "$this->contentForFoo" |