$files->compileIncludeOnce() method

Compile and include_once() the given file

Usage

// basic usage
$files->compileIncludeOnce(string $file);

// usage with all arguments
$files->compileIncludeOnce(string $file, array $options = []);

Arguments

NameType(s)Description
filestring

File to compile and include

options (optional)array

Optional associative array of the following:

  • includes (bool): Also compile files include()'d from the given $file? (default=true)
  • namespace (bool): Compile to make compatible with ProcessWire namespace? (default=true)
  • modules (bool): Allow FileCompilerModule module's to process the file as well? (default=false)
  • skipIfNamespace (bool): Return source $file if it declares a namespace (default=false)

Exceptions

Method can throw exceptions on error:

  • WireException - if given invalid $file or other fatal error


$files methods and properties

API reference based on ProcessWire core version 3.0.155

Twitter updates

  • This post covers a few of the bigger updates in ProcessWire 3.0.154+3.0.155. This includes new live replacement of text in core and modules, a new method for creating canonical URLs, and some major upgrades to our input->urlSegment() method! More
    24 April 2020
  • A brief look at what's new in ProcessWire 3.0.154 in this forum post: More
    17 April 2020
  • This week we’ve got a few new and interesting core updates in progress, though none quite ready to release just yet. So rather than releasing version 3.0.154 today, I thought we'd instead take a brief look at what’s coming over the next few weeks… More
    3 April 2020

Latest news

  • ProcessWire Weekly #311
    In the 311th issue of ProcessWire Weekly we're going to talk a bit about the latest dev versions of ProcessWire, introduce a couple of new third party modules, and more. Read on!
    Weekly.pw / 25 April 2020
  • ProcessWire 3.0.154 and 3.0.155 core updates
    This post covers a few of the bigger updates in ProcessWire 3.0.154 and 3.0.155 on the dev branch. This includes a new function for live replacement of text in core and modules, a new method for creating canonical URLs, and some major upgrades to our $input->urlSegment() method that I think you’ll like!
    Blog / 24 April 2020
  • Subscribe to weekly ProcessWire news

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK