Class Shield

Table of Content

The Shield class will first check whether the given file name is exists in the current active shield folder. If it does exist, then the generated file path will be relative to the current shield folder. If it doesn’t, then it will check whether the given file name is exists in the chunks folder. If it does exist, then the generated file path will be relative to the chunks folder. Otherwise, the generated file path will be relative to ROOT.

Render a Shield

The example below will load article.php file to the page:

Shield::attach('article');

Filters that will affect the loaded shield:

Filter

Description

shield:path

Will affect the generated shield path.

shield:lot

Will affect the generated lot data.

shield:input

Will affect the shield input when output buffer is enabled.

shield:output

Will affect the shield output when output buffer is enabled.

Weapons that will affect the loaded shield:

Hook

Description

shield_lot_before

Will be triggered before lot data extraction.

shield_lot_after

Will be triggered after lot data extraction.

shield_before

Will be triggered before shield output.

shield_after

Will be triggered after shield output.

Render a 404 Page

Shield::abort();

Optional with custom 404 file:

Shield::abort('404-custom');

Shield Variable

Set Variable

Let’s say you have a shield file named as custom.php contains variables like this: