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?
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?
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