debug
This commit is contained in:
@@ -83,44 +83,12 @@ abstract class BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证数据
|
* return fomart view string
|
||||||
* @access protected
|
*
|
||||||
* @param array $data 数据
|
* @param string $strTemplate
|
||||||
* @param string|array $validate 验证器名或者验证规则数组
|
* @return string
|
||||||
* @param array $message 提示信息
|
|
||||||
* @param bool $batch 是否批量验证
|
|
||||||
* @return array|string|true
|
|
||||||
* @throws ValidateException
|
|
||||||
*/
|
*/
|
||||||
protected function validate(array $data, string|array $validate, array $message = [], bool $batch = false)
|
|
||||||
{
|
|
||||||
if (is_array($validate)) {
|
|
||||||
$v = new Validate();
|
|
||||||
$v->rule($validate);
|
|
||||||
} else {
|
|
||||||
if (strpos($validate, '.')) {
|
|
||||||
// 支持场景
|
|
||||||
[$validate, $scene] = explode('.', $validate);
|
|
||||||
}
|
|
||||||
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
|
|
||||||
$v = new $class();
|
|
||||||
if (!empty($scene)) {
|
|
||||||
$v->scene($scene);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$v->message($message);
|
|
||||||
|
|
||||||
// 是否批量验证
|
|
||||||
if ($batch || $this->batchValidate) {
|
|
||||||
$v->batch(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $v->failException(true)->check($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function rending($strTemplate = '')
|
public function rending($strTemplate = '')
|
||||||
{
|
{
|
||||||
View::assign("DomainModel", $this->request->DomainModel);
|
View::assign("DomainModel", $this->request->DomainModel);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class Index extends BaseController
|
|||||||
$arrMoonRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'monthly');
|
$arrMoonRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'monthly');
|
||||||
|
|
||||||
$strStatus = '已完结';
|
$strStatus = '已完结';
|
||||||
$arrEndNovelRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'total',$strStatus);
|
$arrEndNovelRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'total', $strStatus);
|
||||||
|
|
||||||
// Title 模板
|
// Title 模板
|
||||||
ConverterMovel::setVal([
|
ConverterMovel::setVal([
|
||||||
@@ -49,9 +49,9 @@ class Index extends BaseController
|
|||||||
'strIndexDescription' => $this->request->DomainModel->d_index_description,
|
'strIndexDescription' => $this->request->DomainModel->d_index_description,
|
||||||
]);
|
]);
|
||||||
// $strTitle = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__));
|
// $strTitle = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__));
|
||||||
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__).'@TITLE');
|
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE');
|
||||||
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__).'@KEYWORDS');
|
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS');
|
||||||
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__).'@DESCRIPTION');
|
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION');
|
||||||
|
|
||||||
|
|
||||||
$strTitle = ConverterMovel::convert($strTitleTemplate);
|
$strTitle = ConverterMovel::convert($strTitleTemplate);
|
||||||
@@ -71,11 +71,9 @@ class Index extends BaseController
|
|||||||
'strDescription' => $strDescription,
|
'strDescription' => $strDescription,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($boolIsMobile) {
|
$strView = $boolIsMobile ? '' : 'pc/index';
|
||||||
return View::fetch();
|
|
||||||
} else {
|
return $this->rending($strView);
|
||||||
return View::fetch('pc/index');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,7 +90,7 @@ class Index extends BaseController
|
|||||||
|
|
||||||
// 推荐等级为9的连载的 随机15个小说
|
// 推荐等级为9的连载的 随机15个小说
|
||||||
$arrRecommendSerializationNovel = $NovelModel->getHighLevelNovelOnCache($Request->DomainModel->d_domain, 13);
|
$arrRecommendSerializationNovel = $NovelModel->getHighLevelNovelOnCache($Request->DomainModel->d_domain, 13);
|
||||||
|
|
||||||
// 推荐等级为9的完结的 随机12个小说
|
// 推荐等级为9的完结的 随机12个小说
|
||||||
$arrRecommendEndNovel = $NovelModel->getFinishedNovelOnCache($Request->DomainModel->d_domain, 12);
|
$arrRecommendEndNovel = $NovelModel->getFinishedNovelOnCache($Request->DomainModel->d_domain, 12);
|
||||||
|
|
||||||
@@ -157,11 +155,8 @@ class Index extends BaseController
|
|||||||
'strDescription' => $strDescription,
|
'strDescription' => $strDescription,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$strView = $boolIsMobile ? '' : 'pc/index';
|
||||||
|
|
||||||
if ($boolIsMobile) {
|
return $this->rending($strView);
|
||||||
return View::fetch();
|
|
||||||
} else {
|
|
||||||
return View::fetch('pc/index');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,14 +91,14 @@
|
|||||||
|
|
||||||
<!-- 现在是使用这个 -->
|
<!-- 现在是使用这个 -->
|
||||||
{$DomainModel->d_statis|raw}
|
{$DomainModel->d_statis|raw}
|
||||||
{Request->DomainModel->d_statis|raw}
|
{:request()->DomainModel->d_statis}
|
||||||
<!-- FIXED 打开TP模板文档,找到变量原样输出 -->
|
<!-- FIXED 打开TP模板文档,找到变量原样输出 -->
|
||||||
<!-- TODO 问题描述:下面 -->
|
<!-- TODO 问题描述:下面 -->
|
||||||
<!-- 我这边测试: 无法调用用 Request 渲染 , 只能渲染 通过 view:assign() 传递过来的变量 START-->
|
<!-- 我这边测试: 无法调用用 Request 渲染 , 只能渲染 通过 view:assign() 传递过来的变量 START-->
|
||||||
<!-- 1.{Request->DomainModel->d_statis|raw} 这个在页面上展示的 就是: {Request->DomainModel->d_statis} -->
|
<!-- 1.{Request->DomainModel->d_statis|raw} 这个在页面上展示的 就是: {Request->DomainModel->d_statis} -->
|
||||||
<!-- 2.{$DomainModel->d_statis|raw} 使用这个是可以正常渲染的,这个在basecontroll 里面 加入 assign了,你看看这样操作行不-->
|
<!-- 2.{$DomainModel->d_statis|raw} 使用这个是可以正常渲染的,这个在basecontroll 里面 加入 assign了,你看看这样操作行不-->
|
||||||
<!-- TODO END -->
|
<!-- TODO END -->
|
||||||
|
{:request()->DomainModel->d_domian}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user