mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 10:26:32 +00:00
9e590e910ddf7ba52a0e99c5974df9fcff8c79c9
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.
…
…
…
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.
Description
Languages
PHP
99.9%