timber / starter-theme

The "_s" for Timber: a dead-simple theme that you can build anything from
MIT License
811 stars 275 forks source link

2.x Move `StarterSite` class to src folder #143

Closed gchtr closed 7 months ago

gchtr commented 11 months ago

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.