PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Patxi Echarte   Class Loader   example1.php   Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: Example
Class: Class Loader
Locate and load class files from a list of paths
Author: By
Last change:
Date: 18 years ago
Size: 414 bytes
 

Contents

Class file image Download
<?php

include_once('ClassLoader.class.php');

$classLoader =& new ClassLoader();

// To this example works you must create the following folders
$classLoader->addPath(dirname(__FILE__).'/includes', 1);
$classLoader->addPath(dirname(__FILE__).'/admin', 1);
$classLoader->start();

$classLoader->includeClass('MyClass.class.php');

echo
"<pre>";
print_r($classLoader->_classes);
echo
"</pre>";

?>