xp_import

xp_import($name[, $dir = false])

Import a module for usage.

By default modules will be loaded from the modules/ directory located within XPSPL.

Parameters:
  • string – Module name.
  • string|null – Location of the module.
Return type:

void

Example #1 Basic Usage

<?php

// Import the time module
xp_import('time');

Example #2 Importing modules from user-defined directories

<?php

// Import the "foobar" module from our custom module directory
xp_import('foobar', '/my-custom/directory/path');
Read the Docs v: v5.0.1
Versions
latest
v5.0.1
v5.0.0
v4.0.1
v4.0.0
v3.1.1
v3.1.0
v3.0.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.