class Reporter
Constants
OUTPUT_BY_LINE |
Set the reporter to return each output rendering
|
OUTPUT_APPEND |
Set the reporter to append each output rendering to a global output
|
Properties
static array | $default_tag_types | |
static array | $default_masks |
Methods
__construct(null|string $adapter_type = 'html', int $flag = self::OUTPUT_BY_LINE)
Construction of a new Reporter object |
||
Reporter |
reset(bool $hard = false)
Reset all object properties to default or empty values |
|
string |
__toString()
Returns the object global output |
|
Reporter |
setFlag(int $flag)
Set the reporter flag |
|
int |
getFlag()
Get the reporter flag |
|
Reporter |
setAdapterType(string $type)
Set the adapter type to use |
|
object |
getAdapterType()
Get the current adapter name |
|
Reporter |
setAdapter(AbstractAdapter $adapter)
Set the adapter |
|
object |
getAdapter()
Get the current adapter |
|
Reporter |
setOutput(string $output)
Set some content |
|
string |
getOutput()
Get the processed content |
|
string|Reporter |
render(string $content, string $tag_type = 'default', string|array $args = null)
Render a content with a specific tag mask |
|
void |
write(string $content, string $tag_type = 'default', string|array $args = null)
Display on screen a content with a specific tag mask |
|
string|Reporter |
renderMulti(string $content, string $tag_type = 'default', array $multi = array(), string|array $args = null, string $placeholder_mask = '@%s@')
Render a content with a specific tag mask and some placeholders |
Details
at line 118
public
__construct(null|string $adapter_type = 'html', int $flag = self::OUTPUT_BY_LINE)
Construction of a new Reporter object
at line 130
public Reporter
reset(bool $hard = false)
Reset all object properties to default or empty values
at line 145
public string
__toString()
Returns the object global output
at line 160
public Reporter
setFlag(int $flag)
Set the reporter flag
at line 171
public int
getFlag()
Get the reporter flag
at line 183
public Reporter
setAdapterType(string $type)
Set the adapter type to use
at line 201
public object
getAdapterType()
Get the current adapter name
at line 213
public Reporter
setAdapter(AbstractAdapter $adapter)
Set the adapter
at line 232
public object
getAdapter()
Get the current adapter
at line 243
public Reporter
setOutput(string $output)
Set some content
at line 258
public string
getOutput()
Get the processed content
at line 277
public string|Reporter
render(string $content, string $tag_type = 'default', string|array $args = null)
Render a content with a specific tag mask
at line 299
public void
write(string $content, string $tag_type = 'default', string|array $args = null)
Display on screen a content with a specific tag mask
at line 333
public string|Reporter
renderMulti(string $content, string $tag_type = 'default', array $multi = array(), string|array $args = null, string $placeholder_mask = '@%s@')
Render a content with a specific tag mask and some placeholders
This is quite the same as the render()
method but in this case, the $content
string
may contains some placeholders like @name@
that will be replaced in the result by
the name
item of the $multi
array argument after rendering it by the render()
method.
For instance:
$str = $obj->renderMulti( 'my string with @name@ placeholder', 'default', array(
'name' => array( 'a specific string as' , 'strong' )
));
will return:
"<p>my string with <strong>a specific string as</strong> placeholder</p>"