Login * @copyright Tamaranga */ class ForgotPage extends Page { public $step = ''; public function init() { parent::init(); $this->setKey('forgot'); $this->withSeoSettings('forgot', 'users'); $this->setController('users'); $this->setTemplate(function () { return $this->getForm()->render(); }); $this->setTitle(_t('@users', 'Users / Password Recovery')); } /** * Handle page request */ public function handle() { $this->setStep( (! $this->input->has('code') ? 'start' : 'finish') ); } /** * Handle forms submit request * @return \bff\http\Response */ public function onSubmitAction() { return $this->getForm()->submit(); } /** * Set current step * @param string|null $step */ public function setStep(string $step) { $this->step = $step; } /** * Forgot form block * @param string|null $step * @return ForgotStart|mixed */ public function getForm(?string $step = null) { return $this->getBlock($step ?? $this->step); } public function blocks() { $this->addBlock('start', ForgotStart::class); $this->addBlock('finish', ForgotFinish::class); } public function seo() { $this->request->urlCorrection(Users::url('forgot')); $this->seoApply(); } public function seoSettings() { } }