1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,24 +0,0 @@ |
1 |
-<?php |
|
2 |
- |
|
3 |
-class Modele{ |
|
4 |
- |
|
5 |
- public $page; |
|
6 |
- |
|
7 |
- public function __construct($base_param){ |
|
8 |
- |
|
9 |
- if(file_exists(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model')){ |
|
10 |
- $fichier = file(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model'); |
|
11 |
- foreach ($fichier as $ligne_num => $ligne) { |
|
12 |
- if (preg_match("#[ ]*([a-zA-Z-_+]*)[ ]*[:][ ]*([a-zA-Z-_+ ']*[ ]*)#", $ligne, $matches)) { |
|
13 |
- $this->page[$matches[1]] = $matches[2]; |
|
14 |
- } |
|
15 |
- } |
|
16 |
- $this->page['url_params'] = $base_param['params']; |
|
17 |
- }else{ |
|
18 |
- $this->page['name'] = $base_param['name']; |
|
19 |
- $this->page['description'] = $base_param['description']; |
|
20 |
- $this->page['params'] = $base_param['params']; |
|
21 |
- } |
|
22 |
- } |
|
23 |
- |
|
24 |
-} |
... | ... |
@@ -9,7 +9,7 @@ class Modele{ |
9 | 9 |
if(file_exists(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model')){ |
10 | 10 |
$fichier = file(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model'); |
11 | 11 |
foreach ($fichier as $ligne_num => $ligne) { |
12 |
- if (preg_match("#[ ]*([a-zA-Z-_]*)[ ]*[:][ ]*([a-zA-Z-_ ]*[ ]*)#", $ligne, $matches)) { |
|
12 |
+ if (preg_match("#[ ]*([a-zA-Z-_+]*)[ ]*[:][ ]*([a-zA-Z-_+ ']*[ ]*)#", $ligne, $matches)) { |
|
13 | 13 |
$this->page[$matches[1]] = $matches[2]; |
14 | 14 |
} |
15 | 15 |
} |
... | ... |
@@ -9,9 +9,10 @@ class Modele{ |
9 | 9 |
if(file_exists(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model')){ |
10 | 10 |
$fichier = file(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model'); |
11 | 11 |
foreach ($fichier as $ligne_num => $ligne) { |
12 |
- if(preg_match("#[ ]*([a-zA-Z_]*)[ ]*[:][ ]*([a-zA-Z ]*[ ]*)#",$ligne,$matches)){ |
|
13 |
- $this->page[$matches[1]] = $matches[2]; |
|
14 |
- } |
|
12 |
+ if (preg_match("#[ ]*([a-zA-Z-_]*)[ ]*[:][ ]*([a-zA-Z-_ ]*[ ]*)#", $ligne, $matches)) { |
|
13 |
+ $this->page[$matches[1]] = $matches[2]; |
|
14 |
+ } |
|
15 |
+ } |
|
15 | 16 |
}else{ |
16 | 17 |
$this->page['name'] = $base_param['name']; |
17 | 18 |
$this->page['description'] = $base_param['description']; |
... | ... |
@@ -12,8 +12,6 @@ class Modele{ |
12 | 12 |
if(preg_match("#[ ]*([a-zA-Z_]*)[ ]*[:][ ]*([a-zA-Z ]*[ ]*)#",$ligne,$matches)){ |
13 | 13 |
$this->page[$matches[1]] = $matches[2]; |
14 | 14 |
} |
15 |
- } |
|
16 |
- include MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.php'; |
|
17 | 15 |
}else{ |
18 | 16 |
$this->page['name'] = $base_param['name']; |
19 | 17 |
$this->page['description'] = $base_param['description']; |
Signed-off-by: Emmanuel ROY <ornithorynxe@live.fr>
Emmanuel ROY authored on 09/12/2018 04:44:37... | ... |
@@ -6,7 +6,13 @@ class Modele{ |
6 | 6 |
|
7 | 7 |
public function __construct($base_param){ |
8 | 8 |
|
9 |
- if(file_exists(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.php')){ |
|
9 |
+ if(file_exists(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model')){ |
|
10 |
+ $fichier = file(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model'); |
|
11 |
+ foreach ($fichier as $ligne_num => $ligne) { |
|
12 |
+ if(preg_match("#[ ]*([a-zA-Z_]*)[ ]*[:][ ]*([a-zA-Z ]*[ ]*)#",$ligne,$matches)){ |
|
13 |
+ $this->page[$matches[1]] = $matches[2]; |
|
14 |
+ } |
|
15 |
+ } |
|
10 | 16 |
include MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.php'; |
11 | 17 |
}else{ |
12 | 18 |
$this->page['name'] = $base_param['name']; |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,18 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+class Modele{ |
|
4 |
+ |
|
5 |
+ public $page; |
|
6 |
+ |
|
7 |
+ public function __construct($base_param){ |
|
8 |
+ |
|
9 |
+ if(file_exists(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.php')){ |
|
10 |
+ include MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.php'; |
|
11 |
+ }else{ |
|
12 |
+ $this->page['name'] = $base_param['name']; |
|
13 |
+ $this->page['description'] = $base_param['description']; |
|
14 |
+ $this->page['params'] = $base_param['params']; |
|
15 |
+ } |
|
16 |
+ } |
|
17 |
+ |
|
18 |
+} |