PHP Classes

File: example/index.file.loader.php

Recommend this page to a friend!
  Classes of Leonardo Mauro Pereira Moraes   FPHP Loader   example/index.file.loader.php   Download  
File: example/index.file.loader.php
Role: Example script
Content type: text/plain
Description: Example script
Class: FPHP Loader
Load one or more PHP scripts from a directory
Author: By
Last change:
Date: 7 years ago
Size: 457 bytes
 

Contents

Class file image Download
<?php

/* Add the autoload */
require('../dist/php/autoload.php');

/* Call the class `FileLoader` */
use \FPHP_Loader\FileLoader;

/**
* Example: Set extension, loading file and 'path'
*/
$ext = ['html', 'htm'];
$f_loader = new FileLoader();
$f_loader->add_extensions($ext);
$f_loader->load_file('dir_example/wrong_extension.txt');
$f_loader->load_file('1.top.php');
$f_loader->load_dir('dir_example/'); /* Don't include files with wrong extensions */

?>