3.1.21. registerDelimiter()

void registerDelimiter ( string $regExp [, string $lEntName [, string $lEntLook [, string $rEntName [, string $rEntLook]]]] )

Registers a new tag delimiter. The $regExp is a PCRE regular expression (without the modifiers) that defines the look of a delimiter. It has to provide four groups:

  1. (\/?) - for enclosing tags.
  2. (($$NS$$)\:)? - optional namespace
  3. (.*?) - tag content
  4. (\/?) - a slash for single tags.

If you want to customize the namespace look, remember you have to preserve the $$NS$$ string in the expression.

The four optional parameters allow to define the entities that display the left and right part of a delimiter, so that the template designer could also display it.

An example of defining square brackets as a delimiter:

Example 3.11. registerDelimiter()

<?php
  $tpl -> registerDelimiter('\[(\/?)(([a-zA-Z]+)\:)?(.*?)(\/?)\]', 'lsb', '[', 'rsb', ']');
?>

Note: this method is not available, if the Register method family was removed from the source with OPT Configurator.