TheTom
TheTom

Reputation: 1054

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?

Upvotes: 0

Views: 300

Answers (1)

biesior
biesior

Reputation: 55798

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();.

Upvotes: 2

Related Questions