aboutsummaryrefslogtreecommitdiff
path: root/app/class/model.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/class/model.php')
-rw-r--r--app/class/model.php17
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;
+ }
+ }
+
}