Mock up data aka rnd_names, looks for tts_arrays.php if not in tts.php

main
Robert 3 years ago
parent 47738e6546
commit b6e570fed3
  1. 4
      src/before_main.php
  2. 7
      src/ex/models/app/home_model.php
  3. 7
      src/mockup/models/app/home_model.php

@ -4,5 +4,7 @@ declare(strict_types=1);
const PROJECT_BASE_DIR = __DIR__ . '/';
require '/var/www/frames/tts_framework/src/dist/tts.php';
const FW_DIST = '/var/www/frames/tts_framework/src/dist';
require FW_DIST . '/tts.php';
//require '/var/www/frames/tts_framework/src/bootstrap/site_helper.php';

@ -41,6 +41,13 @@ class home_model extends \tts\model {
}
public function populate($rows): void {
if (defined('FW_DIST')) {
$tts_arrays = FW_DIST . '/tts_arrays.php';
if (!class_exists('\tts\rnd_names') && file_exists($tts_arrays)) {
require_once $tts_arrays;
}
}
$dummy = new \tts\dummy_data($this->pdo);
$data = [ 'first_name' => \tts\rnd_names::get_first_names(),
'last_name' => \tts\rnd_names::get_last_names(),

@ -41,6 +41,13 @@ class home_model extends \tts\model {
}
public function populate($rows): void {
if (defined('FW_DIST')) {
$tts_arrays = FW_DIST . '/tts_arrays.php';
if (!class_exists('\tts\rnd_names') && file_exists($tts_arrays)) {
require_once $tts_arrays;
}
}
$dummy = new \tts\dummy_data($this->pdo);
$data = [ 'first_name' => \tts\rnd_names::get_first_names(),
'last_name' => \tts\rnd_names::get_last_names(),

Loading…
Cancel
Save