New Built-in Methods
{vb:set}
{vb:set} is used for assigning template variables during the execution of a template.
Parameter Position | Parameter Name | Type | Required | Description |
1 | variable | string | Yes | The name of the variable being assigned |
2 | value | compilable code | Yes | The value being assigned |
{vb:set name, 'Adrian'} The value of $name is {vb:raw name}.
The value of $name is Adrian.
{vb:template} is used for including other templates in the current template.
Parameter Position | Parameter Name | Type | Required | Description |
1 | template | string | Yes | The name of the template to include |
2...∞ | [var=value] | compilable code | No | Variable to pass local to template |
This is {vb:raw arg1}. Today is {vb:raw arg2}
{vb:template template, arg1="an example", arg2="Sunday"}
This is an example. Today is Sunday
{vb:js} is used for including javascript files from filesystem easily before body close tag.
Parameter Position | Parameter Name | Type | Required | Description |
1...∞ | path[, ...] | relative path | Yes | Relative path of the javascript file to include |
{vb:js js/test.js, js/test1.js}
<script type="text/javascript" src="http://localhost/vb5/js/test.js?v=500a36"></script> <script type="text/javascript" src="http://localhost/vb5/js/test1.js?v=500a36"></script>
{vb:cssextra} is used for including css templates easily before head close tag (all css templates are included in one request).
Parameter Position | Parameter Name | Type | Required | Description |
1...∞ | template[, ...] | string | Yes | The name of the css template |
{vb:cssextra test.css, test1.css}
<link rel="stylesheet" type="text/css" href="http://localhost/vb5/core/css.php?styleid=x&td=xxx&sheet=xxx.css,...,test.css,test1.csss?ts=xxxxxxxxxxx" />
{vb:hook}
{vb:hook} is used for including templates hooks in current template.
Parameter Position | Parameter Name | Type | Required | Description |
1 | hook | string | Yes | The name of the template hook |
{vb:hook test}
{vb:redirect} is used for perfoming a php redirect during the execution of a template.
Parameter Position | Parameter Name | Type | Required | Description |
1 | url | url | Yes | The url of the page to redirect |
{vb:redirect 'http://www.google.com.ar/'}
{vb:strcat} is used for concatenating values to the given variable.
Parameter Position | Parameter Name | Type | Required | Description |
1 | variable | string | Yes | The name of the variable being assigned |
2...∞ | string[, ...] | compiable code | No | The value being concatenated |
{vb:strcat test, 'This is a', ' test'} {vb:raw test}
This is a test
{vb:strrepeat} is used for repeating a string to the given variable.
Parameter Position | Parameter Name | Type | Required | Description |
1 | input | variable | Yes | The string variable to be repeated |
2 | multiplier | variable | Yes | The positive integer variable of time the input should be repeated |
{vb:set input, '. '} {vb:set multipler, 10} {vb:strrepeat input {vb:raw multipler}} {vb:raw input}
. . . . . . . . . .
{vb:data} is used for setting an API class and method return value to the given variable.
Parameter Position | Parameter Name | Type | Required | Description |
1 | variable | string | Yes | The name of the variable being assigned |
2 | controller | string | Yes | The name of the called controller |
3 | method | string | Yes | The name of the called method |
4...∞ | argument | compilable code | No | Variable to pass to called method |
{vb:data unread, content_privatemessage, getUnreadInboxCount} {vb:raw unread}
The above example will output the count of undeleted notifications.
{vb:url}
{vb:url} is used for building an hyperlink url of the specified route.
Parameter Position | Parameter Name | Type | Required | Description |
1 | route | string | Yes | The route identifier (routeid or name) |
2 | data | array | No | Data for building route |
3 | extra | array | No | Additional data to be added |
4 | options | array | No | Options for building URL noBaseUrl: skips adding the baseurl |
{vb:url 'lostpw'}
http://localhost/vb5/lostpw
{vb:debugvardump} is used for dumping information about a variable.
Parameter Position | Parameter Name | Type | Required | Description |
1 | expression | variable | Yes | The variable you want to dump |
{vb:debugvardump $user}
{vb:php}
{vb:php} is used to run allowed php functions during the execution of a template.
Parameter Position | Parameter Name | Type | Required | Description |
1 | function name | string | Yes | The name of the function |
2...∞ | string[, ...] | compiable code | No | Arguments of the function |
{vb:set test, {vb:php implode, ',', {vb:raw variable}}}
<?php
$test = implode(',', $variable);
- implode()
- explode()
- array_merge()
- array_intersect()
- array_intersect_key()
- array_keys()
- array_push()
- array_pop()
- array_shift()
- array_unshift()
- array_unique()
- array()
- current()
- str_repeat()
- str_pad()
- strip_tags()
- strtolower()
- strtoupper()
- trim()
- substr()
- vbstrtolower()