getTitle method

getTitle the current page, this method used only with setTitle method.

Basic Usage

The basic usage for getTitle method is:

getTitle(): string

Parameters

There is no parameter available for getTitle method.

Example Usage

Usually this method called inside a layout file. Here is the basic example for getJsReady method. Here is the content of col-1.php layout file.

<!DOCTYPE html>
<html>
<head>
  <title><?=$this->getTitle()?></title>
</head>
<body>
  ...
</body>
</html>

Here is the full file and directory structures.

|- app/
|-- controller/
|--- home.php
|-- view/
|--- front/
|---- page/
|----- col-1.php

Here is the content of home.php controller file.

class Home extends SENE_Controller
{
  public function __construct()
  {
    parent::__construct();
    $this->setTheme('front');
  }
  public function index()
  {
    ...
    $this->setTitle('Hello World!',$data);
    $this->loadLayout('col-1',$data);
    $this->render();
  }
}

The page title will be Hello World!.