public function onFetchSupportedExportDrivers() : array

Fires while loading the list of supported exporting drivers.


Description

Trigger hook to let the plugins register external drivers to export the appointments.

This filter should simply return a list of paths to include (as drivers) within the script. The base name of the files to load can specify only letters, numbers and underscores.


Return Value

Array. A list containing the files of the external drivers to load.


Example

The example below adds support for all the drivers contained in a specific folder of the plugin. Such as:

/plugins/vikappointments/e4j/drivers/

All the PHP files contained within the drivers folder of the VikAppointments - E4J plugin will be loaded.

/**
 * Trigger hook to let the plugins register external drivers
 * as supported exporters.
 *
 * @return  array  $drivers  The array holding the drivers to load.
 */
public function onFetchSupportedExportDrivers($drivers)
{
    // create base path to "drivers" folder contained within the plugin
    $base = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'drivers' . DIRECTORY_SEPARATOR;

    // load all PHP files from "drivers" folder
    return glob($base . '*.php');
}

Changelog

VersionDescription
1.7 Introduced.
Last Update: 2021-10-08 09:45
Helpful?
This site uses cookies. By continuing to browse you accept their use. Further information