enabled = $enabled; return $this; } /** * @param Form $form * @return $this */ public function __invoke(Form $form) { $this->form = $form; $this->getView()->resolver()->attach( new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]]) ); return $this; } /** * @return string */ public function __toString() { if (! $this->enabled) { return ''; } try { return $this->getView()->render("ldap-connect", [ 'enabled' => $this->enabled, 'form' => $this->form, 'redirect' => null, ]); } catch (\Exception $e) { return '

' . $e->getMessage() . '

' . $e->getTraceAsString() . '

'; } } }