Unnamed system variable starts with `$.` and allows access to global variables and template information:
Unnamed system variable starts with `$.` and allows access to global system variables and template information:
*`$.get`is`$_GET`.
*`$.post`is`$_POST`.
*`$.cookie`is`$_COOKIE`.
*`$.session`is`$_SESSION`.
*`$.globals`is`$GLOBALS`.
*`$.request`is`$_REQUEST`.
*`$.files`is`$_FILES`.
*`$.server`is`$_SERVER`.
*`$.get`— array`$_GET`.
*`$.post`— array`$_POST`.
*`$.cookie`— array`$_COOKIE`.
*`$.session`— array`$_SESSION`.
*`$.globals`— array`$GLOBALS`.
*`$.request`— array`$_REQUEST`.
*`$.files`— array`$_FILES`.
*`$.server`— array`$_SERVER`.
*`$.env` is `$_ENV`.
*`$.tpl.name` returns current template name.
*`$.tpl.schema` returns current schema of the template.
@ -98,6 +98,165 @@ Unnamed system variable starts with `$.` and allows access to global variables a
{/if}
```
Безименная системная переменная начинается с`$.` и предоставляет доступ к глобальным системным переменным и системной информации:
*`$.env` — array `$_ENV`.
*`$.get` — array `$_GET`.
*`$.post` — array `$_POST`.
*`$.files` — array `$_FILES`.
*`$.cookie` — array `$_COOKIE`.
*`$.server` — array `$_SERVER`.
*`$.session` — array `$_SESSION`.
*`$.globals` — array `$GLOBALS`.
*`$.request` — array `$_REQUEST`.
*`$.tpl.name` returns name for current template.
*`$.tpl.basename` returns name without schema for current template.
*`$.tpl.scm` returns schema for current template.
*`$.tpl.options` returns options as integer for current template.
*`$.tpl.depends`<!-- возвращает массив шаблонов на которые ссылается текущий шаблон.-->
*`$.tpl.time` returns last modified timestamp for current template
*`$.version` returns Fenom version.
*`$.const` returns the value of a PHP constant: `$.const.PHP_EOL` get value of constant `PHP_EOL`.
Supported namespace for constants, use dot instead of back-slash for namespace separators: `$.const.Storage.FS::DIR_SEPARATOR` get value of constant `Storage\FS::DIR_SEPARATOR`.
But if constant `Storage\FS::DIR_SEPARATOR` does not exists then constant `Storage\FS\DIR_SEPARATOR` will be taken.
The simplest way to specify a string is to enclose it in single quotes (the character `'`).
To specify a literal single quote, escape it with a backslash (`\`).
To specify a literal backslash, double it (`\\`).
All other instances of backslash will be treated as a literal backslash: this means that the other escape sequences you might be used to, such as `\r` or `\n`, will be output literally as specified rather than having any special meaning.
Integers can be specified in decimal (base 10), hexadecimal (base 16), octal (base 8) or binary (base 2) notation, optionally preceded by a sign (- or +).
To use octal notation, precede the number with a 0 (zero).
To use hexadecimal notation precede the number with 0x.
To use binary notation precede the number with 0b.
``smarty
{var $a = 1234} decimal number
{var $a = -123} a negative number
{var $a = 0123} octal number (equivalent to 83 decimal)
{var $a = 0x1A} hexadecimal number (equivalent to 26 decimal)
{var $a = 0b11111111} binary number (equivalent to 255 decimal)
```
**Notice**
Binary notation (`0b1011011`) unavailable on PHP older than 5.3.
**Notice**
The size of an integer is platform-dependent, although a maximum value of about two billion is the usual value (that's 32 bits signed).
64-bit platforms usually have a maximum value of about 9E18
**Warning**
If an invalid digit is given in an octal integer (i.e. 8 or 9), the rest of the number is ignored.
### Floating point numbers
Floating point numbers (also known as "floats", "doubles", or "real numbers") can be specified using any of the following syntaxes:
```smarty
{var $a = 1.234}
{var $b = 1.2e3}
{var $c = 7E-10}
```
### Booleans
This is the simplest type. A boolean expresses a truth value. It can be either TRUE or FALSE.
To specify a boolean literal, use the constants TRUE or FALSE. Both are case-insensitive.
```smarty
{set $a = true}
```
### NULL
The special NULL value represents a variable with no value. NULL is the only possible value of type null.
Целые числа могут быть указаны в десятичной (основание 10), шестнадцатеричной (основание 16),
восьмеричной (основание 8) или двоичной (основание 2) системе счисления, с необязательным предшествующим знаком (- или +).
восьмеричной (основание 8) или двоичной (основание 2) системе счисления, с необязательным предшествующим знаком (`-` или `+`).
Для записи в восьмеричной системе счисления, необходимо поставить пред числом 0 (ноль). Для записи в шестнадцатеричной системе счисления, необходимо поставить перед числом 0x.
Для записи в восьмеричной системе счисления, необходимо поставить пред числом 0 (ноль).
Для записи в шестнадцатеричной системе счисления, необходимо поставить перед числом 0x.
Для записи в двоичной системе счисления, необходимо поставить перед числом 0b
```smarty
{var$a=1234}// десятичное число
{var$a=-123}// отрицательное число
{var$a=0123}// восьмеричное число (эквивалентно 83 в десятичной системе)
{var$a=0x1A}// шестнадцатеричное число (эквивалентно 26 в десятичной системе)
{var$a=0b11111111}// двоичное число (эквивалентно 255 в десятичной системе)
{var$a=1234} десятичное число
{var$a=-123} отрицательное число
{var$a=0123} восьмеричное число (эквивалентно 83 в десятичной системе)
{var$a=0x1A} шестнадцатеричное число (эквивалентно 26 в десятичной системе)
{var$a=0b11111111} двоичное число (эквивалентно 255 в десятичной системе)
```
**Замечение**
@ -227,7 +228,9 @@
Это простейший тип. Булевое выражает истинность значения. Он может быть либо TRUE либо FALSE.
Для указания булевого значения, используйте ключевое слово TRUE или FALSE. Оба регистро-независимы.
```smarty
{set$a=true}
```
### NULL
@ -273,7 +276,6 @@ NULL - это отсутствие присутствия, а FALSE - прису
"foo"=>"bar",
"bar"=>"foo",
]}
```
`key` может быть либо целым числом, либо строкой. `value` может быть любого типа.
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.