운영 URL에서도 bag 화면은 사이트 메뉴 레이아웃을 사용하도록 수정
요청 경로를 정규화해 bag 접두를 판별하도록 변경하고 지정판매소 경로의 관리자 레이아웃 강제 분기를 제거했습니다.
This commit is contained in:
@@ -51,13 +51,16 @@ abstract class BaseController extends Controller
|
|||||||
protected function renderWorkPage(string $title, string $contentView, array $contentData = []): string
|
protected function renderWorkPage(string $title, string $contentView, array $contentData = []): string
|
||||||
{
|
{
|
||||||
$content = view($contentView, $contentData);
|
$content = view($contentView, $contentData);
|
||||||
$uri = service('request')->getUri();
|
helper('admin');
|
||||||
$seg1 = $uri->getSegment(1);
|
$path = function_exists('current_nav_request_path') ? current_nav_request_path() : '';
|
||||||
$seg2 = $uri->getSegment(2);
|
if ($path === '') {
|
||||||
|
$uri = service('request')->getUri();
|
||||||
// 지정판매소 관리는 관리자 전용 기능으로, /bag 경로여도 관리자 레이아웃을 유지한다.
|
$path = trim((string) $uri->getPath(), '/');
|
||||||
$forceAdminLayoutOnBag = ($seg1 === 'bag' && $seg2 === 'designated-shops');
|
}
|
||||||
if ($seg1 === 'bag' && ! $forceAdminLayoutOnBag) {
|
while (str_starts_with($path, 'index.php/')) {
|
||||||
|
$path = substr($path, strlen('index.php/'));
|
||||||
|
}
|
||||||
|
if ($path === 'bag' || str_starts_with($path, 'bag/')) {
|
||||||
return view('bag/layout/main', [
|
return view('bag/layout/main', [
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'content' => $content,
|
'content' => $content,
|
||||||
|
|||||||
Reference in New Issue
Block a user