Fabien Potencier 9e590e910d merged branch mvrhov/patch-1 (PR #603)
Commits
-------

95f8af7 cast $name to a string as $name can in fact be an object implementing __toString function as true in my case.

Discussion
----------

cast $name to a string ...

... because $name can be an object implementing __toString. I have Enum type implementation which implements __toString. Without the cast I'm getting the following exception:
"An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in isset or empty in... "

---------------------------------------------------------------------------

by fabpot at 2012-01-18T08:43:23Z

From where do you call these methods? from your code? from a template?

---------------------------------------------------------------------------

by mvrhov at 2012-01-18T11:17:55Z

I put the enum object as variable into the template and then based on the enum value I display a block.
2012-02-18 10:00:52 +01:00
2012-02-04 08:38:29 +01:00
2012-02-18 09:55:38 +01:00
2012-02-04 08:38:29 +01:00
2012-01-14 17:17:37 +01:00

Twig, the flexible, fast, and secure template language for PHP

Twig is a template language for PHP, released under the new BSD license (code and documentation).

Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment.

More Information

Read the documentation for more information.

Languages
PHP 99.9%