trait ToStringTrait (View source)

Wraps __toString in a trait to avoid some fatals.

Methods

__toString()

Implements the magic __toString() method.

_die()

For test purposes, wrap die() in an overridable method.

string|object
render()

Renders the object as a string.

Details

__toString()

Implements the magic __toString() method.

protected _die()

For test purposes, wrap die() in an overridable method.

abstract string|object render()

Renders the object as a string.

Return Value

string|object

The rendered string or an object implementing __toString().