public function dyEvaluateStatementsFilter($statements, $chain) {
return $chain->dyEvaluateStatementsFilter(str_replace('foo', 'bar', $statements)); //example
}
to be executed when evaluateStatements is called. All attached behaviors are notified through
dyEvaluateStatementsFilter. The chaining is important in this function due to the filtering
pass-through effect. public evaluateStatements ( $statements ) : string | ||
return | string | content echoed or printed by the PHP statements |
public function evaluateStatements($statements)
{
$statements = $this->dyEvaluateStatementsFilter($statements);
try {
ob_start();
if (eval($statements) === false) {
throw new \Exception('');
}
$content = ob_get_contents();
ob_end_clean();
return $content;
} catch (\Exception $e) {
throw new TInvalidOperationException('component_statements_invalid', get_class($this), $statements, $e->getMessage());
}
}