Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php autoload classes

<?php
function loadModel($class) {
 $path = $DOCUMENT_ROOT . '/models/';
 require_once $path . $class .'.php';
}

function loadView($class) {
 $path = $DOCUMENT_ROOT . '/views/';
 require_once $path . $class .'.php';}
}

spl_autoload_register('loadModel');
spl_autoload_register('loadView');
Source by www.brainbell.com #
 
PREVIOUS NEXT
Tagged: #php #autoload #classes
ADD COMMENT
Topic
Name
9+7 =