Installing extension

Concept of installing and extension is to do it using composer, because we are using it’s autoload capability.

Currently there are few composer packages that are part of the pre-built theme. You can find them here https://packagist.org/packages/netlime-theme/

All you need to do to install a theme extension is to open terminal, cd to theme directory, and run for example following commnad  to install extension that will add <title> to the <head>

php composer.phar require netlime-theme/title

It should output something like this

Eriks-MacBook-Pro:netlime-starter-theme-v2 erikkubica$ php composer.phar require netlime-theme/title
Using version ^1.0 for netlime-theme/title
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing netlime-theme/title (1.0.1): Loading from cache
Writing lock file
Generating autoload files
Eriks-MacBook-Pro:netlime-starter-theme-v2 erikkubica$

Then depending on your function.php configuration (autoload extensions or not) you need to following code to the “after_theme_autoload_modules” action on the in the function.php right below the “### Load modules” comment.

theme()->registerModule("ThemeTitle", new \NetLimeTheme\Extensions\ThemeTitle());

Please note that this extension is already included and you don’t need to install it. It’s just for demonstration purposes.