Skip to content

Commit

Permalink
credit taglib
Browse files Browse the repository at this point in the history
  • Loading branch information
shirne committed Aug 11, 2024
1 parent eabb9e6 commit 328adaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/config/index/template.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* 模板配置
* User: shirne
Expand All @@ -7,8 +8,8 @@
*/

return [
'static_version'=>'20181109',
'view_path'=>Env::get('root_path').'template'.DIRECTORY_SEPARATOR.'blog'.DIRECTORY_SEPARATOR,
'independence'=>false,
'taglib_pre_load'=>'app\common\taglib\Article,app\common\taglib\Product,app\common\taglib\Goods,app\common\taglib\Extendtag'
];
'static_version' => '20181109',
'view_path' => Env::get('root_path') . 'template' . DIRECTORY_SEPARATOR . 'blog' . DIRECTORY_SEPARATOR,
'independence' => false,
'taglib_pre_load' => 'app\common\taglib\Article,app\common\taglib\Product,app\common\taglib\Extendtag,modules\credit\taglib\Goods'
];
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace app\common\taglib;
namespace modules\credit\taglib;


use app\common\core\BaseTabLib;
Expand All @@ -20,7 +20,7 @@ public function tagList($tag)
$recursive = isset($tag['recursive']) ? $tag['recursive'] : 'false';
$category = isset($tag['category']) ? $this->parseArg($tag['category']) : '';
if (is_string($category) && strpos($category, "'") === 0) {
$category = "\\app\\common\\facade\\GoodsCategoryFacade::getCategoryId(" . $category . ")";
$category = "\\modules\\credit\\facade\\GoodsCategoryFacade::getCategoryId(" . $category . ")";
}

$parseStr = '<?php ';
Expand Down Expand Up @@ -57,7 +57,7 @@ public function tagRelation($tag)
$category = isset($tag['category']) ? $tag['category'] : '';
$id = isset($tag['id']) ? $tag['id'] : 0;
if (preg_match('/^[a-zA-Z]\w*$/', $category)) {
$category = "\\app\\common\\facade\\GoodsCategoryFacade::getCategoryId('" . $category . "')";
$category = "\\modules\\credit\\facade\\GoodsCategoryFacade::getCategoryId('" . $category . "')";
}

$parseStr = '<?php ';
Expand Down Expand Up @@ -107,7 +107,7 @@ public function tagCate($tag)

$parseStr = '<?php ';

$parseStr .= '$' . $var . '=\app\common\facade\GoodsCategoryFacade::findCategory(' . $name . ');';
$parseStr .= '$' . $var . '=\modules\credit\facade\GoodsCategoryFacade::findCategory(' . $name . ');';

$parseStr .= ' ?>';
return $parseStr;
Expand Down

0 comments on commit 328adaf

Please sign in to comment.