mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Update configuration.md
This commit is contained in:
parent
44ac3b16e5
commit
68cc6c41b0
@ -24,17 +24,19 @@ Options may by associative array like `'option_name' => true` or bitwise mask.
|
|||||||
|
|
||||||
| Option name | Constant | Description | Affect |
|
| Option name | Constant | Description | Affect |
|
||||||
| ---------------------- | ------------------------- | ------------ | ------- |
|
| ---------------------- | ------------------------- | ------------ | ------- |
|
||||||
| *disable_methods* | `Fenom::DENY_METHODS` | disable calling methods of objects in templates. | |
|
| *disable_methods* | `Fenom::DENY_METHODS` | disable calling methods of objects in templates. | |
|
||||||
| *disable_native_funcs* | `Fenom::DENY_NATIVE_FUNCS`| disable calling native function in templates, except allowed. | |
|
| *disable_native_funcs* | `Fenom::DENY_NATIVE_FUNCS`| disable calling native function in templates, except allowed. | |
|
||||||
| *auto_reload* | `Fenom::AUTO_RELOAD` | reload template if source will be changed | decreases performance |
|
| *auto_reload* | `Fenom::AUTO_RELOAD` | reload template if source will be changed | decreases performance |
|
||||||
| *force_compile* | `Fenom::FORCE_COMPILE` | recompile template every time when the template renders | very decreases performance |
|
| *force_compile* | `Fenom::FORCE_COMPILE` | recompile template every time when the template renders | very decreases performance |
|
||||||
| *disable_cache* | `Fenom::DISABLE_CACHE` | disable compile cache | greatly decreases performance |
|
| *disable_cache* | `Fenom::DISABLE_CACHE` | disable compile cache | greatly decreases performance |
|
||||||
| *force_include* | `Fenom::FORCE_INCLUDE` | paste template body instead of include-tag | increases performance, increases cache size |
|
| *force_include* | `Fenom::FORCE_INCLUDE` | paste template body instead of include-tag | increases performance, increases cache size |
|
||||||
| *auto_escape* | `Fenom::AUTO_ESCAPE` | html-escape each variables outputs | decreases performance |
|
| *auto_escape* | `Fenom::AUTO_ESCAPE` | html-escape each variables outputs | decreases performance |
|
||||||
| *force_verify* | `Fenom::FORCE_VERIFY` | check existence every used variable | decreases performance |
|
| *force_verify* | `Fenom::FORCE_VERIFY` | check existence every used variable | decreases performance |
|
||||||
<!-- | *auto_trim* | `Fenom::AUTO_TRIM` | remove space-characters before and after tags | | -->
|
| *disable_statics* | `Fenom::DENY_STATICS` | disable calling static methods in templates. | |
|
||||||
| *disable_statics* | `Fenom::DENY_STATICS` | disable calling static methods in templates. | |
|
| *strip* | `Fenom::AUTO_STRIP` | strip all whitespaces in templates. | decrease cache size |
|
||||||
| *strip* | `Fenom::AUTO_STRIP` | strip all whitespaces in templates. | decrease cache size |
|
<!--
|
||||||
|
| *auto_trim* | `Fenom::AUTO_TRIM` | remove space-characters before and after tags | |
|
||||||
|
-->
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$fenom->setOptions(array(
|
$fenom->setOptions(array(
|
||||||
@ -52,9 +54,7 @@ By default all options disabled
|
|||||||
|
|
||||||
### Template providers
|
### Template providers
|
||||||
|
|
||||||
Бывает так что шаблны не хранятся на файловой сиситеме, а хранятся в некотором хранилище, например, в базе данных MySQL.
|
Sometimes templates are stored not in the file system, but in some repository, for example, in the MySQL database. In this case, the template needs to describe how to take templates from the repository, how to check the date the template was modified, and where to store the template cache (optional). This task is taken by the `Provider` classes, these are objects realizing the interface `Fenom\ProviderInterface`.
|
||||||
В этом случае шаблонизатору нужно описать как забирать шаблоны из хранилища, как проверять дату изменения шаблона и где хранить кеш шаблонов (опционально).
|
|
||||||
Эту задачу берут на себя Providers, это объекты реальзующие интерфейс `Fenom\ProviderInterface`.
|
|
||||||
|
|
||||||
### Callbacks and filters
|
### Callbacks and filters
|
||||||
|
|
||||||
@ -69,5 +69,3 @@ $fenom->addPreFilter(function () { /* ... */ });
|
|||||||
#### Filter callback
|
#### Filter callback
|
||||||
|
|
||||||
#### After compile callback
|
#### After compile callback
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user