Advertisement
mfiresheets

ZF Training ex2

Aug 27th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2. function __autoload($className)
  3. {
  4.     $basePath  = './';
  5.     $className = str_replace('\\', '/', $className);
  6.     $className = str_replace('_', '/', $className);
  7.     $file      = $basePath . strtolower($className) . '.php';
  8.     if (file_exists($file)) {
  9.         require $file;
  10.     }
  11. }
  12.  
  13. $cup = new Cupboard;
  14. var_dump($cup->insert('spoon')->insert('knife')->remove('spoon')->insert('plate')->getAll());
  15. // ['knife', 'plate']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement