loadVars(); parent::render(); } /** * Load template variables. */ protected function loadVars(): void { $this->vars['template_id'] = Request::get( 'id', '' ); $this->vars['template'] = $this->getTemplate($this->vars['template_id']); } protected function getViewPath(): string { return AFROMEWO_PLUGIN_DIR . 'includes/Admin/Automation/Views/view-template.php'; } protected function getTemplate($id) { try { $meta_messaging = new MetaMessaging(); $template = $meta_messaging->getTemplate($id); return $template; } catch (\Exception $e) { $this->vars['error'] = $e->getMessage(); return false; } } }