\Charcoal\ViewViewableInterface

Defines an object as viewable, and therefore can be rendered.

Summary

Methods
Constants
__toString()
setTemplateIdent()
templateIdent()
setView()
view()
render()
renderTemplate()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

__toString()

__toString() : string

Render the viewable object.

Returns

string

setTemplateIdent()

setTemplateIdent(string  $templateIdent) : \Charcoal\View\ViewableInterface

Set the viewable object's template identifier.

Usually, a path to a file containing the template to be rendered at runtime.

Parameters

string $templateIdent

The template ID.

Returns

\Charcoal\View\ViewableInterface

Chainable

templateIdent()

templateIdent() : string

Retrieve the viewable object's template identifier.

Returns

string

view()

view() : \Charcoal\View\ViewInterface

Retrieve the renderable view.

Returns

\Charcoal\View\ViewInterface

The object's View instance.

render()

render(string  $templateIdent = null) : string

Render the template by the given identifier.

Usually, a path to a file containing the template to be rendered at runtime.

Parameters

string $templateIdent

The template to load, parse, and render. If NULL, will use the object's previously set template identifier.

Returns

string —

The rendered template.

renderTemplate()

renderTemplate(string  $templateString) : string

Render the given template from string.

Parameters

string $templateString

The template to render from string.

Returns

string —

The rendered template.