Another clever SPIP mechanism is the provisioning of tags that might be termed as generic. In fact, it is possible to use a single tag declaration for a whole group of tags prefixed with an identical name.
As such, a tag named #PREFIX_NAME
can use a file called balise/prefix_.php
and delcare a function balise_PREFIX__dist()
which will then be used if there is no balise_PREFIX_NAME_dist($p)
function present.
The generic function, which accepts tag attributes in the $p
variable, can use $p->name_field
to obtain the name of the requested tag (in this case "PREFIX_NAME"). By analysing this name, it can then execute the appropriate actions.