Backend and Infrastructure

Symfony Autoloading

This page is archived

We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.

Alternate resources

Sprout Video

Autoloading is the magic that lets us use classes without needing to require or include the file that holds them first. An autoloader has a tricky job: given any class name, it needs to know the exact location of the file that holds that class. In many modern projects, including ours, Composer handles this for us, and there are two pieces to understanding how it figures out what file a class lives in. In this lesson we're going to get an overview of how directory structures and namespaces make autoloading work.

Additional resources

The Wonderful World of Composer