setWebRoot('/content/'); $dirTree = $scanner->scan(__DIR__ . '/../../../www/content/', 4); $readmeFile = $scanner->getDefaultReadme(); $titles = []; $content = ''; $html = ''; if (!empty($readmeFile)) { $titles = $scanner->getMDTitles($readmeFile['id']); $content = file_get_contents($readmeFile['realpath']); $Parsedown = new Parsedown(); $html = $Parsedown->text($content); $html = $scanner->fixMDUrls($readmeFile['realpath'], $html); } //alert message test //$this->sendMsgToClient('Alert message - danger', 'danger'); //$this->sendMsgToClient('Alert message - warning', 'warning'); //$this->sendMsgToClient('Alert message - success', 'success'); //$this->sendMsgToClient('Alert message - info', 'info'); $pageTitle = "FileSite.io - 无数据库、基于文件和目录的网址导航、图书、图片、视频网站PHP开源系统"; $viewName = 'index'; $params = compact('dirTree', 'readmeFile', 'titles', 'content', 'html'); return $this->render($viewName, $params, $pageTitle); } }