ExpressionEngine Docs

Core Library Extension Hooks


Parameter Type
Returns Void

Run tasks on every ExpressionEngine request.

How it’s called:

if (ee()->extensions->end_script === TRUE) return;

Note: This hook fires on every ExpressionEngine request, so be mindful of the speed and resource usage of your code here. If you need to run code based on the type of request, the REQ constant can be checked to determine the type of request. It will either be PAGE for front-end requests, CP for control panel requests, or ACTION for module action requests (ACT= URLs). e.g.:

if (REQ != 'CP')
  // Do work only on control panel requests


Parameter Type Description
$uri_string String Current URI string
Returns Array Array containing the name of the template group and template (see below)

Reassign the template group and template loaded for parsing.

How it’s called:

$edata = ee()->extensions->call('core_template_route', ee()->uri->uri_string);
if (is_array($edata) && count($edata) == 2)
    list($template_group, $template) = $edata;

Example of array to return:

    'template_group', // Template group name
    'template'        // Template name