Skip to content

Commit

Permalink
Add frontend controller in screen. (#2835)
Browse files Browse the repository at this point in the history
* Add frontend controller in screen.

* Change default frontend controller in base layout.

---------

Co-authored-by: volkov <aleksandr.volkov@ma.ru>
  • Loading branch information
DarKsandr and volkov authored May 24, 2024
1 parent 6312985 commit 6fbac6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/layouts/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@section('title', (string) __($name))
@section('description', (string) __($description))
@section('controller', 'base')
@section('controller', $controller)

@section('navbar')
@foreach($commandBar as $command)
Expand Down
9 changes: 9 additions & 0 deletions src/Screen/Screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public function view(array|Repository $httpQueryArguments = [])
'formValidateMessage' => $this->formValidateMessage(),
'needPreventsAbandonment' => $this->needPreventsAbandonment(),
'state' => $this->serializeStateWithPublicProperties($repository),
'controller' => $this->frontendController(),
]);
}

Expand Down Expand Up @@ -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';
}
}

0 comments on commit 6fbac6c

Please sign in to comment.