forked from projects/fipamo
34 lines
728 B
PHP
34 lines
728 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers;
|
||
|
|
||
|
class DashController extends Controller
|
||
|
{
|
||
|
protected $files = [];
|
||
|
protected $folder = '../content/pages';
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
$this->read($this->folder);
|
||
|
}
|
||
|
|
||
|
public function start()
|
||
|
{
|
||
|
var_dump($this->files[2]);
|
||
|
return view('back.start', []);
|
||
|
}
|
||
|
|
||
|
public function read($folder)
|
||
|
{
|
||
|
$folders = glob("$folder/*", GLOB_ONLYDIR);
|
||
|
foreach ($folders as $folder) {
|
||
|
//$this->files[] = $folder . "/";
|
||
|
$this->read($folder);
|
||
|
}
|
||
|
$files = array_filter(glob("$folder/*md"), 'is_file');
|
||
|
foreach ($files as $file) {
|
||
|
$this->files[] = $file;
|
||
|
}
|
||
|
}
|
||
|
}
|