Roots Discourse

Autoloading in bedrock

I am using bedrock for the first time and I have setup a child theme in it. I want to know how to add a class in the theme so it is autoloaded just like how the rest of bedrock is working.

  1. set up composer autoloads in your child theme
  2. require the composer autoloader in your child theme, example:

Note: This is unrelated to bedrock. You can use this technique on non-bedrock projects.

See also:

1 Like