private function generateItemForm() { $hasPage = isset($this->page); $title = $hasPage ? $this->page->getTitle() : ''; $slug = $hasPage ? $this->page->getSlug() : ''; $bodyContent = $hasPage ? $this->page->getBody() : ''; return \Primitive\Tools::render($this->templates . 'form.html', ['titleId' => self::$title, 'titleContent' => $title, 'slugId' => self::$slug, 'slugContent' => $slug, 'textAreaId' => self::$body, 'textAreaContent' => $bodyContent, 'submitId' => self::$updatePage]); }
public function loginSuccessful(Credentials $credentials) { if (isset($_POST[self::$keep])) { $expiration = $credentials->getTemporaryExpiration(); CookieHelper::set(self::$cookieName, $credentials->getUsername(), $expiration); CookieHelper::set(self::$cookiePassword, $credentials->getTemporaryPassword(), $expiration); } \Primitive\Tools::redirect(); }
private function generateNavigation() { $logoutButton = \Primitive\Tools::render($this->templates . 'logoutButton.html', ['buttonName' => self::$logout]); return $this->links . $logoutButton; }