Composer Autoloading

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

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

Log in Sign up
  • 0:07
    OK, guys, confession time.
  • 0:10
    This cool little autoloader idea where we make our class name match our file name
  • 0:14
    and our namespace match our directory structure.
  • 0:18
    Well, that was not my idea.
  • 0:21
    In fact, this idea has been around in PHP for years.
  • 0:25
    And every modern project follows it.
  • 0:28
    That's nice for consistency and organization
  • 0:31
    but it's also nice for a much more important reason.
  • 0:35
    We can write a single autoloader function that can find anyone's code.
  • 0:40
    Our code or a third-party code that we include in our project.
Loading ...