1 Star 0 Fork 103

zhenyangze/VvvebJs

forked from Gitee 极速下载/VvvebJs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
editor.php 999 Bytes
一键复制 编辑 原始数据 按行查看 历史
<?php
//include 'editor.html';
$html = file_get_contents('editor.html');
//search for html files in demo and my-pages folders
$htmlFiles = glob('{my-pages/*.html,demo/*\/*.html, demo/*.html}', GLOB_BRACE);
$files = '';
foreach ($htmlFiles as $file) {
if (in_array($file, array('new-page-blank-template.html', 'editor.html'))) continue;//skip template files
$pathInfo = pathinfo($file);
$filename = $pathInfo['filename'];
$folder = preg_replace('@/.+?$@', '', $pathInfo['dirname']);
$subfolder = preg_replace('@^.+?/@', '', $pathInfo['dirname']);
if ($filename == 'index' && $subfolder) {
$filename = $subfolder;
}
$url = $pathInfo['dirname'] . '/' . $pathInfo['basename'];
$name = $filename;
$title = ucfirst($name);
$files .= "{name:'$name', file:'$file', title:'$title', url: '$url', folder:'$folder'},";
}
//replace files list from html with the dynamic list from demo folder
$html = str_replace('= defaultPages;', " = [$files];", $html);
echo $html;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/zhenyangze/VvvebJs.git
git@gitee.com:zhenyangze/VvvebJs.git
zhenyangze
VvvebJs
VvvebJs
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385