For a better code structure, we can add StarterSite to its own class in a src folder. This is also the approach you would use to autoload classes using Composer.
I didn’t add the autoload entry to composer.json itself, because (as @szepeviktor noted in https://github.com/timber/starter-theme/pull/143#pullrequestreview-1554111989) developers would best use a namespaced approach. But if we defined a default namespace, we could end up with a lot of themes not updating from the default namespace, which is not better.
This pull request also moves the Timber::$autoescape = false to that class, calling it the way we advise in Timber 2.0.
For a better code structure, we can add
StarterSite
to its own class in a src folder. This is also the approach you would use to autoload classes using Composer.I didn’t add the
autoload
entry to composer.json itself, because (as @szepeviktor noted in https://github.com/timber/starter-theme/pull/143#pullrequestreview-1554111989) developers would best use a namespaced approach. But if we defined a default namespace, we could end up with a lot of themes not updating from the default namespace, which is not better.This pull request also moves the
Timber::$autoescape = false
to that class, calling it the way we advise in Timber 2.0.