Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
backend
php
oop
classes_objects
69interface_spl_autoload.php
69interface_spl_autoload.php
<?php /**Primjer pokazuje upotrebu spl_autoload fje *za ucitavanje interfejsa **/ class MojLoader{ //mora biti static da se moze //pozvati sa MojLoader::load_classlib public static function load_classlib($class_name) { $filename=strtolower($class_name).'.class.php'; $put='./classlib/'.$filename; if(is_readable($put)) include $put; else return false; } } //register the loader functions spl_autoload_register('MojLoader::load_classlib'); $obj=new Peta; $obj->metoda(); ?>
Reload page
Preview
W3C validation
Edit Code