You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
960 B
PHTML

2 years ago
<?php
namespace App\Http\Controllers\Front;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;
class PagesController extends Controller
{
protected $page = [
'code' => 'pages',
'title' => '갤러리소개',
'subTitle' => '',
'description' => '',
'link' => '/'
];
/**
* 일반페이지
*
* @Verb : GET
* @Path : /pages/{code}
* @param Request $request
* @param string $code
* @return View
*/
public function index(Request $request, string $code = '')
{
$data = [];
$this->page['code'] .= '.' . $code;
$pages = config('pages');
if (array_key_exists($code, $pages)) {
$this->page['subTitle'] = $pages[$code];
$view = 'pages.'. $code;
} else {
return redirect('/');
}
return $this->setView($view, $data);
}
}