Autoloading Awesomeness

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:08
    Have you ever heard of an autoloader?
  • 0:10
    Even if you have, you might not know what they do or how they work.
  • 0:15
    Autoloaders change everything.
  • 0:18
    In PHP, you can't reference a class or a function unless you
  • 0:23
    or someone requires or includes that file first.
  • 0:27
    That's why in bootstrap.php, we have a require statement for every file.
  • 0:34
    Without these, we can't access the classes inside of them.
  • 0:38
    This is no bueno, it means that I have to remember to add another line here
  • 0:43
    whenever I create a new class.
  • 0:47
    You know why else it's not good?
Loading ...