assetsController = $assetsController; $this->pageRenderer = $pageRenderer; $this->templateStorage = $templateStorage; $this->wp = $wp; } public function render() { $this->assetsController->setupAutomationTemplatesDependencies(); $this->pageRenderer->displayPage( 'automation/templates.html', [ 'sub_menu' => 'mailpoet-automation', 'locale_full' => $this->wp->getLocale(), 'api' => [ 'root' => rtrim($this->wp->escUrlRaw($this->wp->restUrl()), '/'), 'nonce' => $this->wp->wpCreateNonce('wp_rest'), ], 'templates' => array_map( function(AutomationTemplate $template): array { return $template->toArray(); }, $this->templateStorage->getTemplates() ), ] ); } }