From 6fbac6c1b9b3a5d973104ff77bf8ab14f17de47c Mon Sep 17 00:00:00 2001 From: Aleksandr Volkov <56652592+DarKsandr@users.noreply.github.com> Date: Fri, 24 May 2024 17:58:26 +0400 Subject: [PATCH] Add frontend controller in screen. (#2835) * Add frontend controller in screen. * Change default frontend controller in base layout. --------- Co-authored-by: volkov --- resources/views/layouts/base.blade.php | 2 +- src/Screen/Screen.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 87c363166..0a5c7b818 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -2,7 +2,7 @@ @section('title', (string) __($name)) @section('description', (string) __($description)) -@section('controller', 'base') +@section('controller', $controller) @section('navbar') @foreach($commandBar as $command) diff --git a/src/Screen/Screen.php b/src/Screen/Screen.php index beb8603cb..6a3bda898 100644 --- a/src/Screen/Screen.php +++ b/src/Screen/Screen.php @@ -218,6 +218,7 @@ public function view(array|Repository $httpQueryArguments = []) 'formValidateMessage' => $this->formValidateMessage(), 'needPreventsAbandonment' => $this->needPreventsAbandonment(), 'state' => $this->serializeStateWithPublicProperties($repository), + 'controller' => $this->frontendController(), ]); } @@ -498,4 +499,12 @@ public function backWith(array $data): RedirectResponse return back()->with('_state', $this->serializableState($repository)); } + + /** + * Name frontend controller in screen. + */ + public function frontendController(): string + { + return 'base'; + } }