filesite
1 year ago
4 changed files with 99 additions and 15 deletions
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
<?php |
||||
/** |
||||
* List Controller |
||||
*/ |
||||
require_once __DIR__ . '/../../../lib/DirScanner.php'; |
||||
require_once __DIR__ . '/../../../plugins/Parsedown.php'; |
||||
require_once __DIR__ . '/SiteController.php'; |
||||
|
||||
Class ApiController extends SiteController { |
||||
|
||||
public function actionIndex() { |
||||
//获取数据 |
||||
$menus = array(); //菜单,一级目录 |
||||
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 |
||||
$htmlCateReadme = ''; //当前目录下的Readme.md 内容 |
||||
$menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 |
||||
|
||||
$scanner = new DirScanner(); |
||||
$scanner->setWebRoot(FSC::$app['config']['content_directory']); |
||||
$dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 3); |
||||
//$scanResults = $scanner->getScanResults(); |
||||
|
||||
$code = 1; |
||||
$msg = ''; |
||||
$err = ''; |
||||
|
||||
//获取tags分类 |
||||
$data = $this->getTags($dirTree); |
||||
|
||||
|
||||
return $this->renderJson(compact('code', 'msg', 'err', 'data')); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue