Update docs files

This commit is contained in:
Paweł Klockiewicz
2017-05-12 12:10:53 +02:00
parent d81dba8f01
commit cba4056ffb
2 changed files with 16 additions and 4 deletions

View File

@@ -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'];
})
```

View File

@@ -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'];
})
```