운영 URL에서도 bag 화면은 사이트 메뉴 레이아웃을 사용하도록 수정

요청 경로를 정규화해 bag 접두를 판별하도록 변경하고 지정판매소 경로의 관리자 레이아웃 강제 분기를 제거했습니다.
This commit is contained in:
taekyoungc
2026-04-14 00:28:02 +09:00
parent 734a55833b
commit 078fa5d0c2

View File

@@ -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);
helper('admin');
$path = function_exists('current_nav_request_path') ? current_nav_request_path() : '';
if ($path === '') {
$uri = service('request')->getUri(); $uri = service('request')->getUri();
$seg1 = $uri->getSegment(1); $path = trim((string) $uri->getPath(), '/');
$seg2 = $uri->getSegment(2); }
while (str_starts_with($path, 'index.php/')) {
// 지정판매소 관리는 관리자 전용 기능으로, /bag 경로여도 관리자 레이아웃을 유지한다. $path = substr($path, strlen('index.php/'));
$forceAdminLayoutOnBag = ($seg1 === 'bag' && $seg2 === 'designated-shops'); }
if ($seg1 === 'bag' && ! $forceAdminLayoutOnBag) { 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,