# Pages

Wolff pages are highly related to a controller which can call other views, libraries and languages.

View

The views should be in the app/views folder with its name in lowercase and with html or php extension.

The views use the optional template system.

Controller

The controllers files should be in the main/controllers folder with its name in lowercase and with php extension.

A home.php controller should look like this:

namespace Controller;

class Home extends \Core\Controller {

    public function index() {

    }
}

A controller class must extend from \Core\Controller, have its namespace as its route, have a public index function, and the class name must be the same as the filename that contains the class.

The index function is called when loading the controller.

Database

You can read about the queries and the database connection in the Database page.

A controller that makes a query should looks like this:

namespace Controller;

use Core\DB;

class Home extends \Core\Controller {

    public function index() {
        DB::run('SELECT * FROM table');
    }
}

Language

A language must be in the app/languages/{languageOfChoice} folder and have a php extension, the language must have an associative array to return to the class calling it.

A home.php language should look like this:

$data['title'] = 'Wolff';
$data['message'] = 'Hello world';
$data['album'] = 'Sleep Well Beast';