PHP Classes

File: core/autoload.php

Recommend this page to a friend!
  Classes of Ali Sharifi   MVC 4 Dummies   core/autoload.php   Download  
File: core/autoload.php
Role: Auxiliary script
Content type: text/plain
Description: Class source
Class: MVC 4 Dummies
Web development PHP MVC framework
Author: By
Last change:
Date: 9 years ago
Size: 503 bytes
 

Contents

Class file image Download
<?php
spl_autoload_register
(function ($class) {
    if (
$class == "Smarty") {
        require_once(
"libs/smarty/Smarty.class.php");
        return
true;
    }
   
$dirs = array(
       
'biz',
       
'controllers',
       
'core',
       
'core/helper',
       
'lib',
       
'model');

    foreach (
$dirs as $dir) {
       
$filename = "$dir/" . $class . ".php";
        if (
file_exists($filename)) {
            require_once(
$filename);
            return
true;
        }
    }
    return
false;
});