2017-06-13 22:54:16 +02:00
|
|
|
<?php
|
|
|
|
|
2019-03-14 16:48:02 +01:00
|
|
|
namespace MVC\Classe;
|
|
|
|
|
2017-06-13 22:54:16 +02:00
|
|
|
class Modele{
|
|
|
|
|
|
|
|
public $page;
|
|
|
|
|
|
|
|
public function __construct($base_param){
|
|
|
|
|
2018-12-09 04:44:37 +01:00
|
|
|
if(file_exists(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model')){
|
|
|
|
$fichier = file(MODELS_PATH.DIRECTORY_SEPARATOR.$base_param['name'].'.model');
|
|
|
|
foreach ($fichier as $ligne_num => $ligne) {
|
2019-08-09 09:25:45 +02:00
|
|
|
if (preg_match("#[ ]*([a-zA-Z-_+]*)[ ]*[:][ ]*([0-9a-zA-Z-_+ ']*[ ]*)#", $ligne, $matches)) {
|
2019-03-05 13:26:50 +01:00
|
|
|
$this->page[$matches[1]] = $matches[2];
|
|
|
|
}
|
|
|
|
}
|
2019-03-05 16:49:15 +01:00
|
|
|
$this->page['url_params'] = $base_param['params'];
|
2017-06-13 22:54:16 +02:00
|
|
|
}else{
|
|
|
|
$this->page['name'] = $base_param['name'];
|
|
|
|
$this->page['description'] = $base_param['description'];
|
|
|
|
$this->page['params'] = $base_param['params'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|