typo3fluidview-helpers

typo3 viewhelper call method inside viewhelper class


How can I call a (own written ) method inside a viewhelper?

public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {

$this->myMethod();

I guess it won't work this way?


Solution

  • Each ViewHelper is a standalone class, if that method myMethod() is declared within this class, make it static private static function myMethod(){...} and call as self::myMethod();.