[eluser]fedeisas[/eluser]
[quote author="Chillahan" date="1306556442"]That's cool too. How come you use $this->data though, and not just a local array $data? Are you doing something modular or re-using the data somewhere? (just curious!)[/quote]
Nope, nothing fancy in there. I've just copy pasted some code, and that's why I've used $this->data. You can just pass a regular array to json_encode, and that's it. I use this json_view a lot when handling ajax request (form validations, populating dropdowns, etc.).