debug
This commit is contained in:
@@ -5,16 +5,16 @@ declare(strict_types=1);
|
||||
use app\home\controller\Index;
|
||||
use app\home\controller\Novel;
|
||||
use app\home\controller\User;
|
||||
use app\services\SiteContext;
|
||||
use think\facade\Route;
|
||||
|
||||
|
||||
Route::get('/article/fenlei/:category', function (\think\Request $Request) {
|
||||
return view('test/test01/index.html');
|
||||
Route::get('/article/fenlei/:category', function (\think\Request $Request, SiteContext $SiteContext) {
|
||||
return view($SiteContext->getHomeView());
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 路由配置文件
|
||||
*/
|
||||
|
||||
14
code/app/home/view/default/test/test01/faker.html
Normal file
14
code/app/home/view/default/test/test01/faker.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{novel:info n_id="$DomainModel->n_id" n_key="arrNovel01" n_forge_id="1125940" /}
|
||||
<title>{$arrNovel01.n_name} - 首页</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{$arrNovel01.n_description}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{site:grm page_code="fdasfadsf" diff="fadsfdsa" num="10" g_key="arrGrm" /}
|
||||
{php}var_dump($arrGrm);{/php}
|
||||
<!-- {site:grm page_code="fdasfadsf" diff="fadsfdsa" num="10" g_key="arrGrm" /}
|
||||
{php}var_dump($arrGrm);{/php} -->
|
||||
|
||||
<!-- {chapter:info n_id="1" c_sort_num="200" c_page="0" c_key="arrChapter01" /}
|
||||
{$arrChapter01.c_name} -->
|
||||
@@ -50,8 +50,8 @@
|
||||
|
||||
|
||||
|
||||
<!-- {novel:info n_id="33" n_key="arrNovel01" n_forge_id="1125940" /}
|
||||
{$arrNovel01.n_name} -->
|
||||
{novel:info n_id="33" n_key="arrNovel01" n_forge_id="1125940" /}
|
||||
{$arrNovel01.n_name}
|
||||
|
||||
<!-- {$DomainModel->d_domain} -->
|
||||
|
||||
|
||||
@@ -125,4 +125,19 @@ class SiteContext
|
||||
|
||||
return GanRaoMaModel::getGrmCode($strDomain, $strPageCode, $strDiff, $intNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* get home view
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHomeView(): string
|
||||
{
|
||||
if ($this->DomainModel->n_id > 0) {
|
||||
$strView = 'test/test01/faker.html';
|
||||
} else {
|
||||
$strView = 'test/test01/index.html';
|
||||
}
|
||||
return $strView;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user