assetsController = $assetsController; $this->pageRenderer = $pageRenderer; $this->registry = $registry; $this->wp = $wp; } public function render() { $this->assetsController->setupAutomationTemplatesDependencies(); $this->pageRenderer->displayPage( 'automation/templates.html', [ '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(); }, array_values($this->registry->getTemplates()) ), ] ); } }