init

Is a virtual function for Html class is needed for inizialize derivate class like Template.

void init ()

Parameters

None.

Return Values

None.

Examples

Typical Controller.php init.

<?php
  public function init() {
    parent::init();
    $this->tags["title"]  .= "Home";
    $this->tags["content"] = $this->makePage();
  }
?>

Typical Template.php init.

<?php
  public function init() {
    $this->addConnection("config/connection.json");
    $this->addFilesRequired([
      "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css",
      "https://code.jquery.com/jquery-3.2.1.slim.min.js",
      "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js",
      "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js",
      "css/template.css"
    ]);
    $this->template = "bundles/views/tradictional.jate";
    $this->tags = [
      "title"    => "JATE - ",
      "brand"    => "JATE",
      "brandImg" => "",
      "menu"     => $this->makeMenu(),
      "metaDescription" => "Beautiful description.",
      "metaKeywords"    => "JATE,PHP,JS,CSS",
      "metaAuthor"      => "XaBerr"
    ];
  }
?>