{"comment":{"created_at":"2011-10-21T18:47:15Z","body":"ive resorted to the var['key'] way... keeps things \"working\" lol... been a\nbitch converting all the templates tho\n\nOn Wed, Oct 19, 2011 at 2:41 AM, martinml <\nreply@reply.github.com>wrote:\n\n> `dot_as_object` doesn't seem to work in some cases. For example, with this\n> quite convoluted array:\n>\n> ```\n> $categories = array(\n>        'books' => array(\n>                'subcategories' => array(\n>                        array(\n>                                'name' => 'novel',\n>                                'aisle' => 1\n>                        ),\n>                        array(\n>                                'name' => 'poetry',\n>                                'aisle' => 2\n>                        )\n>                )\n>        ),\n>        'movies' => array(\n>                'subcategories' => array(\n>                        array(\n>                                'name' => 'action',\n>                                'aisle' => 3\n>                        ),\n>                        array(\n>                                'name' => 'thriller',\n>                                'aisle' => 4\n>                        )\n>                )\n>        )\n> );\n> ```\n>\n> And this template:\n>\n> ```\n> {% for category in categories %}\n>        {% for subcategory in category.subcategories %}\n>                {{ subcategory.name. }} is in aisle {{ subcategory.aisle }}\n>        {% endfor %}\n> {% endfor %}\n> ```\n>\n> You always get `Trying to get property of non-object`, since the generated\n> code is `$subcategory->name` and `$subcategory->aisle`, which obviously is\n> incorrect. Setting `dot_as_object` as `false` makes no difference.\n>\n> As SugaSlide said, using the `subcategory['name']` notation works, but\n> that's 3 more keystrokes than a simple dot :)\n>\n> --\n> Reply to this email directly or view it on GitHub:\n> https://github.com/crodas/Haanga/issues/6#issuecomment-2449905\n>","updated_at":"2011-10-21T18:47:15Z","url":"https://api.github.com/repos/crodas/Haanga/issues/comments/2484826","id":2484826,"user":{"avatar_url":"https://secure.gravatar.com/avatar/17f283cbf8a7ceecffe3ed7f0a5adb41?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"17f283cbf8a7ceecffe3ed7f0a5adb41","url":"https://api.github.com/users/SugaSlide","id":182800,"login":"SugaSlide"}},"action":"created","issue":{"number":6,"created_at":"2011-09-03T14:30:35Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"as the heading says..\r\n\r\nsend an array to the template.\r\n\r\nand you get this error intermitently.\r\n\r\nsolution is to use  {{ this['that'] }} instead of {{ this.that }} - i accept its probably the more correct way to do it.. but then why bother using templating in the first place? im sure i saw somewhere that the correct way to use haanga was this.that ","comments":6,"title":"this.that evals to $this->that and throws \"Trying to get property of non-object\" error","updated_at":"2011-10-21T18:47:15Z","url":"https://api.github.com/repos/crodas/Haanga/issues/6","id":1558124,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/17f283cbf8a7ceecffe3ed7f0a5adb41?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"17f283cbf8a7ceecffe3ed7f0a5adb41","url":"https://api.github.com/users/SugaSlide","id":182800,"login":"SugaSlide"},"html_url":"https://github.com/crodas/Haanga/issues/6","labels":[],"state":"open"},"legacy":{"issue_id":1558124,"comment_id":2484826}}