User Tools

Site Tools




Vortex String

The Vortex String, or VxString for short, is a string which uses a custom syntax for variable substituion in the Vortex. The syntax and substitution rules are described below.


The VxString is parsed by the Vortex using a regular expression, from left to right. Variable names enclosed by []-brackets are substituted by their respective variable/field relative to the current Table or TableRecord. Functions or class methods enclosed by {}-brackets are substituted by the return value from the corresponding call. Parameters are concatenated by appending a .-separated list after the function/method name, and variables can be used by enclosing them in []-brackets.


  This is the id of this post: [idpost]
  This is the name of some related post: []
  Running a Vortex-internal function getting the date: {date}
  Getting the date a week from now: {date.w+1}
  Running a php function: {abs.-1}
  Running some method from some class with parameters "a", "b" and name from the current tablerecord/table: {class:method.a.b.[name]}
  Running a method in this current Tablemethods script with the same parameters: {method.a.b.[name]}

Functions are identified in the following order:

1. Internal vortex functions
2. Class:Method methods
3. Internal PHP functions
4. Methods in the Tables Methods-class.

Vortex internal functions

Currently the following functions are implemented locally in the Vortex:


Using an older syntax, used to modify strings.


Will take the leftmost 3 characters of string..

The supported modifiers are left, right, mid, where mid takes two arguments separated by : like:


Where the first argunent is from and the last is to. The given syntax above would return tr.


Returns the date on the format YYYY-mm-dd. Otherwise similar to time.


Returns the datetime on the format YYYY-mm-dd HH:ii:ss as given by the PHP date function.
The timestamp can be modified by giving arguments like


This will return the datetime for tomorrow but the year will be set to 2010.

Currently the following modifiers are supported with a +, - or = sign and a value, telling the Vortex to add, subtract or set the period.


As of build 1167 the time and date functions also take a format argument on the form of the PHP date format string.


The code above returns the year and month, two months from the current date, separated by a slash.


Returns an attribute from the currently active user. Supplying no parameters will return the UUID for the active user, otherwise it will return the given attribute. Related attributes can be used providing the current user has sufficient privilegies to read them.

vortex/scripting/vxstring.txt · Last modified: 2019/06/28 06:56 by hubbe