abstract
Description
<nnt3:abstract />
This ViewHelper is not a separate ViewHelper that can be used in Fluid.
It serves as a base class for your own ViewHelper.
| $escapeOutput = false is set as the default.
If XSS attacks could be a problem with your ViewHelper, this should be overwritten.
Use extend in your own ViewHelper to use it.
Here is an example boilerplate with everything you need to get started:
registerArgument('title', 'string', 'info', false);
}
public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext ) {
// Simply use `$title` instead of `$arguments['title']`
foreach ($arguments as $k=>$v) {
${$k} = $v;
}
// Render content between the ViewHelper tag
if (!$title) $title = $renderChildrenClosure();
// Example to get all current variables in the Fluid template
// $templateVars = \nn\t3::Template()->getVariables( $renderingContext );
return $title;
}
}
Copied!