phalcon/docs — pull request #340 by kolypto (2014-02-12 20:29:56+00:00)
Title: Volt filters: default

[Volt filters](http://docs.phalconphp.com/en/latest/reference/volt.html#filters) docs say:

> default	Sets a default value in case that the evaluated expression is null

Actually, the generated PHP code for `{{ var|default('?') }}` looks like this:

```php

```

which means that `$var` can be `0`, `null`, `false`, `''` and even not defined at all. Since this behavior is very useful, I assume that's a bug in the docs and should be corrected to:

> default Sets a default value in case that the evaluated expression is empty (is not set or evaluates to a falsy value)