get

Fires when the application is ready.

Table of Contents
  1. Description
  2. Example

Description

This hook fires when the application is ready. That is, when the default response status, MIME type, and time zone are declared, and when all the extensions and tasks are loaded.

Example

Hook::set('get', function () use ($url) {
    // Run your custom layout system hereā€¦
    $app = new Leaf\App;
    $app->get($url->path ?? '/', function () use ($app) {
        $app->response()->markup('<h1>asdf</h1>', 200);
    });
    $app->run();
});

body

Modifies the body part of the current HTML response.

content

Modifies the current HTML response.

enter

Modifies the current HTTP response headers.

exit

Fires after script execution ends.

get

Fires when the application is ready.

head

Modifies the head part of the current HTML response.

let

Fires when the application finishes rendering.

set

Fires when the application is ready, before the core task is loaded.