diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2019-10-18 14:20:55 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2019-10-18 14:20:55 +0200 |
commit | 1d011471674ede030407c351abfbf2bfc93d8b7a (patch) | |
tree | 91bbe902de1d9c31eea09eb3961781f5886cf70c /app/class/model.php | |
parent | 8b6848dfb5d469076f05be226e862fab928cd53f (diff) | |
download | wcms-1d011471674ede030407c351abfbf2bfc93d8b7a.tar.gz wcms-1d011471674ede030407c351abfbf2bfc93d8b7a.zip |
new page render system
create html files in `/render` folder
Diffstat (limited to 'app/class/model.php')
-rw-r--r-- | app/class/model.php | 17 |
1 files changed, 17 insertions, 0 deletions
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; + } + } + } |