Added the folder containg Fipamo markdown files to set up a basic route for the start of the dashboard and quick test to make sure the file paths can be read also added CSS files that will style the new template system, which is currenlty in twig but will be convereted to blade
33 lines
728 B
PHP
33 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;
|
|
}
|
|
}
|
|
}
|