From 1d011471674ede030407c351abfbf2bfc93d8b7a Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Fri, 18 Oct 2019 14:20:55 +0200 Subject: new page render system create html files in `/render` folder --- app/class/model.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/class/model.php') diff --git a/app/class/model.php b/app/class/model.php index 6f5a62d..45ac2d1 100644 --- a/app/class/model.php +++ b/app/class/model.php @@ -12,6 +12,7 @@ abstract class Model const THUMBNAIL_DIR = 'media' . DIRECTORY_SEPARATOR . 'thumbnail' . DIRECTORY_SEPARATOR; const TEMPLATES_DIR = '.'. DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'view' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR; const RENDER_DIR = 'assets'. DIRECTORY_SEPARATOR . 'render' . DIRECTORY_SEPARATOR; + const HTML_RENDER_DIR = 'render' . DIRECTORY_SEPARATOR; const GLOBAL_DIR = 'assets'. DIRECTORY_SEPARATOR . 'global' . DIRECTORY_SEPARATOR; const DATABASE_DIR = '.' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR; @@ -92,4 +93,20 @@ abstract class Model return self::dirtopath(Model::ICONS_DIR); } + /** + * Check if dir exist. If not, create it + * + * @param string $dir Directory to check + * + * @return bool return true if the dir already exist or was created succesfullt. Otherwise return false + */ + public function dircheck(string $dir) : bool + { + if (!is_dir($dir)) { + return mkdir($dir); + } else { + return true; + } + } + } -- cgit v1.2.3