|
|
|
@ -11,28 +11,19 @@ namespace Project\controllers\app; |
|
|
|
|
|
|
|
|
|
|
|
use \CodeHydrater\base_controller; |
|
|
|
use \CodeHydrater\base_controller; |
|
|
|
use \CodeHydrater\enums\view_type as ViewType; |
|
|
|
use \CodeHydrater\enums\view_type as ViewType; |
|
|
|
use \CodeHydrater\http\response as Response; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Description of home_ctrl URL Route: /FOLDER/FILE/METHOD |
|
|
|
* Description of home_ctrl URL Route: /FOLDER/FILE/METHOD |
|
|
|
* /app/home/name_demo |
|
|
|
* /app/home/name_demo |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class home_ctrl extends base_controller { |
|
|
|
class home_ctrl extends base_controller { |
|
|
|
private $footer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function init() { |
|
|
|
public function init() { |
|
|
|
// FROM on_footer_banner.php in the configs folder... |
|
|
|
// Defined from: on_footer_banner.php in the configs folder... |
|
|
|
if (function_exists("\Project\get_footer")) { |
|
|
|
$this->set_footer_and_authors(); |
|
|
|
$this->footer = \Project\get_footer(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$this->footer = ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function index(): Response { |
|
|
|
public function index() { |
|
|
|
$this->html->set_footer($this->footer); |
|
|
|
|
|
|
|
$this->html->set_author("Robert Strutts, plus ME!"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->view->set('html', $this->html); |
|
|
|
$this->view->set('html', $this->html); |
|
|
|
$this->view->set_template('main'); |
|
|
|
$this->view->set_template('main'); |
|
|
|
$this->view->include("app/header", ViewType::PHP); |
|
|
|
$this->view->include("app/header", ViewType::PHP); |
|
|
|
@ -43,7 +34,7 @@ class home_ctrl extends base_controller { |
|
|
|
return $this->response; |
|
|
|
return $this->response; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function name_demo(): Response { |
|
|
|
public function name_demo() { |
|
|
|
echo $this->footer; |
|
|
|
echo $this->footer; |
|
|
|
|
|
|
|
|
|
|
|
$this->view->set('twig_data', ['name' => "John Doe"]); |
|
|
|
$this->view->set('twig_data', ['name' => "John Doe"]); |
|
|
|
@ -53,7 +44,7 @@ class home_ctrl extends base_controller { |
|
|
|
return $this->response; |
|
|
|
return $this->response; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function liquid(): Response { |
|
|
|
public function liquid() { |
|
|
|
echo $this->footer; |
|
|
|
echo $this->footer; |
|
|
|
$this->view->set('template_assigns', [ |
|
|
|
$this->view->set('template_assigns', [ |
|
|
|
'name' => "James Smith", |
|
|
|
'name' => "James Smith", |
|
|
|
@ -65,7 +56,7 @@ class home_ctrl extends base_controller { |
|
|
|
return $this->response; |
|
|
|
return $this->response; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function extra(): Response { |
|
|
|
public function extra() { |
|
|
|
$loaded = \CodeHydrater\extras_booter::tryToEnableFeature("testing", refresh: true); |
|
|
|
$loaded = \CodeHydrater\extras_booter::tryToEnableFeature("testing", refresh: true); |
|
|
|
if ($loaded === false) { |
|
|
|
if ($loaded === false) { |
|
|
|
$content = "Unable to load Feature..."; |
|
|
|
$content = "Unable to load Feature..."; |
|
|
|
@ -77,31 +68,11 @@ class home_ctrl extends base_controller { |
|
|
|
return $this->response; |
|
|
|
return $this->response; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function make_hash(): Response { |
|
|
|
public function make_hash() { |
|
|
|
$content = \CodeHydrater\security::do_password_hash("Hello, World"); |
|
|
|
$content = \CodeHydrater\security::do_password_hash("Hello, World"); |
|
|
|
|
|
|
|
|
|
|
|
$this->response->set_content($content); |
|
|
|
$this->response->set_content($content); |
|
|
|
return $this->response; |
|
|
|
return $this->response; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* from Routes |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function test(int $id): Response { |
|
|
|
|
|
|
|
$content = "The ID for Test Example is # $id"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->response->set_content($content); |
|
|
|
|
|
|
|
return $this->response; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function demo(?string $name="Test", ?int $limit=10, ?int $page=1): Response { |
|
|
|
|
|
|
|
$content = "DEMO Name: ". \CodeHydrater\bootstrap\safer_io::p($name); |
|
|
|
|
|
|
|
$content .= "LIMIT = ". $limit; |
|
|
|
|
|
|
|
$content .= "PAGE = ". $page; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->response->set_content($content); |
|
|
|
|
|
|
|
return $this->response; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|