Currency Converter

  • Currency
  • US$ Amount

Modifiers functions

As it has been explained before in the variables tag, modifiers are functions that modify the variable value before printing it and you can write your own modifier function to use within the blocks by following these steps:

  • Create a file within the 'include/modifiers' folder using this name form '' where 'name' is the function name.
  • Write the following function formula in the function file:

function Dimofinf_modifier_name($params)

function Dimofinf_modifier_name($params)
    	$string = $params['string'];
	// the code 
	return $string;

Where 'name' is the function name and '$params' is a matrix that includes the function parameters which are called when the modifier is called from within the block as every entry takes an index in the '$params' matrix and its value is the inserted value and it also includes the 'String' index which contains the variable value, noting that the function should return a value at the end where '$val' is an example for the reference value from the function. Please note that modifiers can be called several times for the same variable simultaneously.

      Helping modifiers which can be used in the blocks:

These are some useful modifiers which can help you with your programming and blocks:

      {var|calc values="5,5,8" sign="+"}

This modifier is used to perform mathematical operations on the variable 'var' value.



  • sign (optional): the operation sign; '+' for addition, '-' for subtraction, '*' for multiplication and '/' for division.
  •  values (mandatory): the values the mathematical operations will be done on.


{var|calc values="5,5,8" sign="+"|calc  values="1" sign="*"}

This modifier will perform the first mathematical operation by adding '5+5+8' then it will perform the second operation by multiplying the result of the first operation by '1'.

      {string|default value="value"}

This modifier is used to assign the default value in case the 'string' value is empty.


  • value (mandatory): the default value that will be assigned if the main variable value is empty.


{title|default value="Dimofinf CMS"}

      {string|replace values="value_before,value_after"}

This modifier is used to replace words from the 'string' variable value.


  • values (mandatory): includes the value you want to replace and the word you want to replace it with; these two are separated by a comma.


{string|replace values="hello,hello dimofinf"}

      {string|wordwrap length="90" break="n" cut="true"}

This modifier is used to break the sentence after a certain number of characters where the function 'wordwrap' is called from PHP.


  • length (mandatory): the number of characters after which the sentence is broken; moves to the next line.
  • break (optional): the division separator, it is '/n' by default.
  • cut (optional):when this is assigned to 'true', the division/breaking is forced. In other words, if you have a word is 8 characters and you set the sentence break at 4 characters, the word will be forced to break after 4 characters and won't be excluded because it is a connected word.


{string|wordwrap length="10" break="<br>"}

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Blocks system (Views: 871)

Dimofinf offers you an exclusive state of the art blocks system through which you can separate...

Helping functions which can be used in the blocks (Views: 903)

      {function:alternate name="blockname" values="alt1,alt2"} This function is used to...

$tpl object functions within the PHP file (Views: 663)

    - mk_template($var) This function is called to create a $tpl object as special $tpl...

Helping function used for blocks (Views: 827)

This is a set of helping functions which can be used in your programming for some ready parts...

Block system tags within the block files & Variables, constants and general variables (Views: 1033)

Block system tags within the block files: The blocks system has several tags that are placed in...