Include a PHP file passing it all API variables and optionally your own specified variables
This is the procedural version of the
This is the same as PHP’s
include() function except for the following:
- It receives all API variables and optionally your custom variables
- If your filename is not absolute, it doesn’t look in PHP’s include path, only in the current dir.
- It only allows including files that are part of the PW installation: templates, core modules or site modules
- It will assume a “.php” extension if filename has no extension.
Note this function produces direct output. To retrieve output as a return value, use the
$files->render() function instead.
// basic usage $bool = wire
Include(string $filename); // usage with all arguments $bool = wire File Include(string $filename, array $vars = array, array $options = include); File
Filename to include
Optional variables you want to hand to the include (associative array)
Array of options to modify behavior:
Always returns true
Method can throw exceptions on error:
WireException- if file doesn’t exist or is not allowed
API reference based on ProcessWire core version 3.0.168