There is no other way?? :-/
This wont work for me since $res object will be far more complicated (this
is just a simple example) and I have no intention to iterate thru 4-5 levels
(thats just silly)..
Jake McGraw wrote:
Assuming it's Iterable, if not, use type casting first:
$res =
Hi all, I'm studying AjaxContent helper to stop my previous practice to just
echo things from controller for json responses..
Now, I have one question:
I have a object like this:
$res-rows = 1;
$res-columns = 2;
Now, I pass that object to view:
$this-view-res = $res;
And I get json response
foreach($res as $field = $value) {
$this-view-{$field} = $value;
}
On Tue, Dec 22, 2009 at 4:28 PM, Eugen_cro eugen.bo...@tvz.hr wrote:
Hi all, I'm studying AjaxContent helper to stop my previous practice to just
echo things from controller for json responses..
Now, I have one question:
Assuming it's Iterable, if not, use type casting first:
$res = (array) $res;
- jake
On Tue, Dec 22, 2009 at 4:46 PM, Jake McGraw jmcgr...@gmail.com wrote:
foreach($res as $field = $value) {
$this-view-{$field} = $value;
}
On Tue, Dec 22, 2009 at 4:28 PM, Eugen_cro eugen.bo...@tvz.hr