Example #1
0
 /**
  * This function creates the class in the database,
  * Also creates a .php file template with the class name in the controllers folder
  * @param $Request
  * @param $class
  * @return void
  */
 private static function CreateModel($Request, $class)
 {
     if (is_dir("models")) {
         @mkdir('models', 0755, true);
     }
     $created = file_put_contents("models/model_" . $Request->Get->table_name . ".php", $class);
     if (!$created) {
         Dialog::Danger("Error", "There was an error creating the class on the controllers folder!", "Ok");
     }
 }