2. Intro to the /nv/ folder
The theme’s NV/
folder contains the entire NOUVEAU library. This library is used to dramatically speed up your back-end theme development by handling a lot of the common set-up and configuration tasks for you.
These are the contents of NV/
…
Custom
This folder is where you should put your own new code and classes and corresponds to the NV\Theme\Custom
namespace. By default, this includes just one file (which is automatically loaded by NOUVEAU): WalkerComments.php
. The \WalkerComments
class serves as NOUVEAUs default handler for comments. Feel free to customize this to your own needs.
These files are little more than a suggestion, but can prove useful for keeping your code organized. The underscore prefix is used in this case to denote that the contents are global scope.
Hooks
One of NOUVEAU‘s strengths is that all the important theme hooks are already handled for you. Each hook is neatly organized into a meaningful class ( NV\Hooks\Config
, NV\Hooks\Editor
, and NV\Hooks\ThemeCustomize
) under this folder. This will be discussed in more detail later in this Quick Start guide. This directory corresponds to the NV\Theme\Custom
namespace
Utilities
This folder contains “utility” classes, sometimes called “helper classes” by other frameworks. These are occasionally used in NOUVEAU‘s core, but exist primarily to speed and aid development. This will be discussed in more detail later in this Quick Start guide. This directory corresponds to the NV\Theme\Utilities
namespace
NV.php
This file contains the core NV
class. This class loads and initializes everything needed to get your theme running: autoloader, hooks, theme properties, et al. By using a singleton pattern for this class we can ensure that hooks are never accidentally executed more than once. This pattern also allows us to drop sloppy global theme constants in favor of class properties. To access the class instance, simply call NV\Theme\NV::i()
. This class will be discussed in more detail later in this Quick Start guide.
This page was last updated on December 20, 2015 – it is currently considered COMPLETE.