|
|
|
|
@ -9,18 +9,18 @@ declare(strict_types = 1); |
|
|
|
|
*/ |
|
|
|
|
namespace Project\controllers\app; |
|
|
|
|
|
|
|
|
|
use \CodeHydrater\base_controller; |
|
|
|
|
use \CodeHydrater\enums\view_type as ViewType; |
|
|
|
|
use \CodeHydrater\http\request as Request; |
|
|
|
|
use \CodeHydrater\http\response as Response; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Description of home_ctrl URL Route: /FOLDER/FILE/METHOD |
|
|
|
|
* /app/home/name_demo |
|
|
|
|
*/ |
|
|
|
|
class home_ctrl { |
|
|
|
|
class home_ctrl extends base_controller { |
|
|
|
|
private $footer; |
|
|
|
|
|
|
|
|
|
public function __construct(private Request $request, private Response $response) { |
|
|
|
|
public function init() { |
|
|
|
|
// FROM on_footer_banner.php in the configs folder... |
|
|
|
|
if (function_exists("\Project\get_footer")) { |
|
|
|
|
$this->footer = \Project\get_footer(); |
|
|
|
|
@ -30,16 +30,14 @@ class home_ctrl { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function index(): Response { |
|
|
|
|
$html = new \CodeHydrater\html_document(); |
|
|
|
|
$html->set_footer($this->footer); |
|
|
|
|
$html->set_author("Robert Strutts, plus ME!"); |
|
|
|
|
|
|
|
|
|
$view = new \CodeHydrater\view(); |
|
|
|
|
$view->set('html', $html); |
|
|
|
|
$view->set_template('main'); |
|
|
|
|
$view->include("app/header", ViewType::PHP); |
|
|
|
|
$view->include("app/footer", ViewType::PHP); |
|
|
|
|
$content = $view->fetch($this, "app/home_index", ViewType::PHP); |
|
|
|
|
$this->html->set_footer($this->footer); |
|
|
|
|
$this->html->set_author("Robert Strutts, plus ME!"); |
|
|
|
|
|
|
|
|
|
$this->view->set('html', $this->html); |
|
|
|
|
$this->view->set_template('main'); |
|
|
|
|
$this->view->include("app/header", ViewType::PHP); |
|
|
|
|
$this->view->include("app/footer", ViewType::PHP); |
|
|
|
|
$content = $this->view->fetch($this, "app/home_index", ViewType::PHP); |
|
|
|
|
|
|
|
|
|
$this->response->set_content($content); |
|
|
|
|
return $this->response; |
|
|
|
|
@ -58,13 +56,11 @@ class home_ctrl { |
|
|
|
|
|
|
|
|
|
public function liquid(): Response { |
|
|
|
|
echo $this->footer; |
|
|
|
|
|
|
|
|
|
$view = new \CodeHydrater\view(); |
|
|
|
|
$view->set('template_assigns', [ |
|
|
|
|
$this->view->set('template_assigns', [ |
|
|
|
|
'name' => "James Smith", |
|
|
|
|
'date' => date('Y-m-d') |
|
|
|
|
]); |
|
|
|
|
$content = $view->fetch($this, "app/liquid", ViewType::LIQUID); |
|
|
|
|
$content = $this->view->fetch($this, "app/liquid", ViewType::LIQUID); |
|
|
|
|
|
|
|
|
|
$this->response->set_content($content); |
|
|
|
|
return $this->response; |
|
|
|
|
|