ComboStrap UI - Pipeline

1 - About

A pipeline is a element that contains a list of function (called a pipeline) that transforms successively a string.

Pipeline are used in template when you want to transform a variable such as a page title.

3 - Syntax



<pipeline> value | function | function | ... </pipeline>


where:

  • value is the string to transform
  • function is one of:
    • replace - replace a string
    • rconcat - add a string at the right side
    • head - cut the string to a maximum number of characters

4 - Functions

4.1 - Replace

replace is a function that will search a string and replace it.

Syntax:



replace($search, $replace)


For instance:



<pipeline> "Prefix - Title" | replace("Prefix - ","") </pipeline>


Output:

Title

4.2 - Rconcat

rconcat is a function that will concatenate a string to the right

Syntax:



rconcat($string)


For instance:



<pipeline> "Title" | rconcat("...") </pipeline>


Output:

Title...

head is a function that will take the fist N characters of a string

Syntax:



head($length)


For instance:



<pipeline> "Long Title that we want to cut" | head(10) | rconcat("...") </pipeline>


Output:

Long Title...