Templates or plug-ins?

Use the "squelettes" folder

The squelettes/ folder is used to store all the files required for the operation of your site and to customise its graphic design: templates (or “squelettes”, images, JavaScript and CSS files, PHP libraries, ...).

Or create a plug-in

A plug-in, stored in a folder like plugins/name_of_the_plugin/, can also contain any or all of the files that your site might require, just like the squelettes/ folder. Additionally, a plug-in supports some additional actions, essentially those required to install and uninstall the plug-in.

So, is it best to write a plug-in or simply use the squelettes folder?

Generally speaking, the squelettes/ folder is used to store everything that is specific to a particular site. Only when a piece of code is generic and reusable does it makes sense to package it as a plug-in.

Author Thomas Sutton Published : Updated : 16/02/10

Translations : English, français