Dynamic Modal View

I want to pop out the content inside the modal but it pops up only on data, same data all the time


public function actionList()


		$data = array();


		$trends=new CDbCriteria;

        $trends->order = 'created DESC';


		$trends->addCondition("vid=(SELECT MAX(vid) FROM content WHERE id=t.id)")

		         ->addCondition('type_id >= 2')

		         ->addCondition('password = ""')

		         ->addCondition('category_id = 2')

		         ->addCondition('status = 1');


		$trends_list = Content::model()->findAll($trends);



		$this->render('all', array('trends_list'=>$trends_list));		



<?php foreach($trends_list as $content): ?>

<?php $this->renderPartial('//content/_recent', array('content' => $content)); ?>

<?php endforeach; ?>	


<div id="myModal" class="modal hide">

    <div class="modal-header">

      <button class="close" data-dismiss="modal">&times;</button>

      <h3><?php echo $content->slug; ?></h3>


    <div class="modal-body">            

        <div id="modalContent">

			<?php echo $content->content; ?>



    <div class="modal-footer">

      <a href="#" class="btn btn-info" data-dismiss="modal" >Close</a>



<a href="#myModal" data-toggle="modal" id="<?php echo $content->id; ?>"><?php echo $content->slug;?></a>





	               cache: false,

	               type: 'POST',

	               url: "<?php echo $this->createUrl('/' . $content->slug); ?>"+$(this).attr('id'),

	               data: '',

	               success: function(data) 








First you should try to open your ajax url in browser (without modal), and if content is changing as needed this is the problem with modals.

I suppose you’re using bootstrap modal, try to clear data like this:

$('#myModal').on('hidden', function() {



or this (for bootstrap 3):

$(document.body).on('hidden.bs.modal', function () {



check this wiki