Hey guys and gals,
Wondering if someone can point me in the right direction here. I need
to do some ajax calls and I was going to jquery for those. I know how
to code straight php and ajax, but I am having a hard time wrapping my
head around how I would do it with cakePhp.
what i have so far (and not working yet) is that I made modal called
ajax with $userTable =false and a controler ajax_controller with $uses
= "Ajax" and $layout = "ajax" (the layout "ajax.thtml" file consist of
<?php echo $content_for_layout ?>)
in the controller i have a function:
function toggleActive(){
$json = array(
"car" => "mine",
"bike" => "yours"
); // just test data
$this->set('json_array',$json);
}
and i have a view: toggleActive.thtml with this code in it:
<?php
if(!empty($json_array)):
foreach($json_array as $json => $js):
if($json):
echo $json . ":" . $js;
endif;
endforeach;
endif;
?>
As it stands now, i go to
http://www.kenzohosting.com/wesco/www/ajax/toggleactive and I get the
layout for the homepage and not what I would expect.
Any help would be greatly appreciated.
--------------------------------------------------------------------
Benjamin Sterling
KenzoMedia.com
KenzoHosting.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---