<?php

declare(strict_types=1);

namespace prj\ex\controllers\app;

use \tts\use_iol as IOL;

class home_ctrl {
  public $page_output;
    
  public function index() {
      $html = new \tts\html_document();
      $html->set_author("Robert Strutts, plus ME!");

      $view = new \tts\view();
      $view->set('html', $html);
      $view->set_template('main');
      $view->include("app/header");
      $view->include("app/footer");
      $view->render($this, "app/home_index");
  }
    
  public function name_demo() {
      $view = new \tts\view();
      $view->set('html', new \tts\html_document());
      $view->set_template('main');
      $view->include("app/name_demo");
      $view->render($this);
  }
  
  public function name_demo_post() {  
      $output = IOL::auto_wire("app", "home", "name_demo");
      
      $view = new \tts\view();
      $view->set('html', new \tts\html_document());
      $view->set('output', $output);
      $view->set_template('main');
      $view->include("app/name_demo_post");
      $view->render($this);
  }
      
  public function error() { tts_broken_error(); } // Needed: To show Live Page for Broken Pages

}