From: Fabien Potencier Date: Sat, 18 Feb 2012 09:00:52 +0000 (+0100) Subject: merged branch mvrhov/patch-1 (PR #603) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=9e590e910ddf7ba52a0e99c5974df9fcff8c79c9;p=konrad%2Ftwig.git 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. --- 9e590e910ddf7ba52a0e99c5974df9fcff8c79c9