tags:

views:

235

answers:

1

In my application i need to update multiple divs. we can give the div names in array. But i dont know how to render two ctp files in controller.

for one ctp $this->render('newctp','ajax');

I want to know how to update for two?

A: 

Put the two .ctp files you need to render into elements (more info here). Then, in your view, render both elements. Like this:

myAjaxView.ctp

<?php $this->render('myFirstElement'); ?>
<?php $this->render('mySecondElement'); ?>

and you'd have two ctp files under views/elements (myFirstElement.ctp and mySecondElement.ctp) that would contain the html you'd like rendered.

Good luck

inkedmn
I don't think your "(more info here)" link got included in your response.
chollida