mirror of
https://github.com/sruupl/batflat.git
synced 2026-03-09 18:10:14 +01:00
Update docs files
This commit is contained in:
10
docs/en.md
10
docs/en.md
@@ -1265,16 +1265,22 @@ Operating the template system is easy and is based primarily on two methods. One
|
||||
void set(string $name, mixed $value)
|
||||
```
|
||||
|
||||
Assigns a value to a variable that can be used in views.
|
||||
Assigns a value or function to a variable that can be used in views.
|
||||
|
||||
#### Arguments
|
||||
+ `name` — variable name
|
||||
+ `value` — variable value
|
||||
+ `value` — variable value or anonymous function
|
||||
|
||||
#### Example
|
||||
```php
|
||||
// Assignment of the array
|
||||
$foo = ['bar', 'baz', 'qux'];
|
||||
$this->tpl->set('foo', $foo);
|
||||
|
||||
// Assign an anonymous function
|
||||
$this->tpl->set('bar', function() {
|
||||
return ['baz' => 'qux'];
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
|
||||
10
docs/pl.md
10
docs/pl.md
@@ -1264,16 +1264,22 @@ Obsługa systemu szablonów jest łatwa i opiera się głównie na dwóch metoda
|
||||
void set(string $name, mixed $value)
|
||||
```
|
||||
|
||||
Przypisuje wartość do zmiennej, którą będzie można się posługiwać w widokach.
|
||||
Przypisuje wartość lub funkcję do zmiennej, którą będzie można się posługiwać w widokach.
|
||||
|
||||
#### Argumenty
|
||||
+ `name` — nazwa zmiennej
|
||||
+ `value` — wartość zmiennej
|
||||
+ `value` — wartość zmiennej lub anonimowa funkcja
|
||||
|
||||
#### Przykład
|
||||
```php
|
||||
// Przypisanie tablicy
|
||||
$foo = ['bar', 'baz', 'qux'];
|
||||
$this->tpl->set('foo', $foo);
|
||||
|
||||
// Przypisanie funkcji anonimowej
|
||||
$this->tpl->set('bar', function() {
|
||||
return ['baz' => 'qux'];
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user