Documentation

Horde_View_Helper_Capture extends Horde_View_Helper_Base
in package

Capture lets you extract parts of code which can be used in other points of the template or even layout file.

Tags
author

Mike Naberezny mike@maintainable.com

author

Derek DeVries derek@maintainable.com

author

Chuck Hagenbuch chuck@horde.org

license

http://www.horde.org/licenses/bsd

category

Horde

subpackage

Helper

Table of Contents

$_view  : Horde_View
The parent view invoking the helper.
__call()  : mixed
Call chaining so members of the view can be called (including other helpers).
__construct()  : mixed
Creates a helper for $view.
__get()  : mixed
Proxy on undefined property access (get).
__set()  : mixed
Proxy on undefined property access (set).
capture()  : Horde_View_Helper_Capture_Base
Capture allows you to extract a part of the template into an instance variable.
contentFor()  : Horde_View_Helper_Capture_ContentFor
Calling contentFor() stores the block of markup for later use.

Properties

Methods

__call()

Call chaining so members of the view can be called (including other helpers).

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string

The method.

$args : array<string|int, mixed>

The parameters for the method.

Return values
mixed

The result of the method.

__construct()

Creates a helper for $view.

public __construct(Horde_View $view) : mixed
Parameters
$view : Horde_View

The view to help.

Return values
mixed

__get()

Proxy on undefined property access (get).

public __get(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

__set()

Proxy on undefined property access (set).

public __set(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed
Return values
mixed

capture()

Capture allows you to extract a part of the template into an instance variable.

public capture() : Horde_View_Helper_Capture_Base

You can use this instance variable anywhere in your templates and even in your layout. Example:

capture() ?> Welcome To my shiny new web page! greeting = $capture->end() ?>
Return values
Horde_View_Helper_Capture_Base

contentFor()

Calling contentFor() stores the block of markup for later use.

public contentFor(string $name) : Horde_View_Helper_Capture_ContentFor

Subsequently, you can retrieve it inside an instance variable that will be named "contentForName" in another template or in the layout. Example:

contentFor("header") ?> <script type="text/javascript">alert('hello world')</script> end() ?>

// Use $this->contentForHeader anywhere in your templates:

contentForHeader ?>
Parameters
$name : string

Name of the content that becomes the instance variable name. "foo" -> "$this->contentForFoo"

Return values
Horde_View_Helper_Capture_ContentFor

Search results