使用YII中的时间间隔调用渲染部分

I want to update a div contents automatically with refresh whole page. So i did Ajax renderPartial in YII. Now I implement using AJAX button onclick

My code as follows

<?php 
      echo CHtml::ajaxButton ("Update data",
      CController::createUrl("blog/UpdateAjax?url=$url"), 
      array('update' => '#inrscrn'));
?>

Now I want to render with in a time limit please help

Your question is not very clear. I suppose you want to setup an automatical & periodical refresh of the content within a div instead of clicking on the button.

This is the JavaScript you need on your page:

<script type="text/javascript">
    timeout = 60 * 1000; // in Milliseconds -> multiply with 1000 to use seconds
    function refresh() {
        <?php
        echo CHtml::ajax(array(
                'url'=> CController::createUrl("blog/UpdateAjax?url=".$url),
                'type'=>'post',
                'update'=> '#inrscrn',
        ))
        ?>
    }
    window.setInterval("refresh()", timeout);
</script>

But it is not a good approach to send an URL to your controler, rather make a direct request to to make a special AJAX return of a controler which needs to return the correspondent data.

<?php
public function actionTest(){
        if (isset($_REQUEST['AJAX']) || Yii::app()->getRequest()->getIsAjaxRequest()) {
            $this->renderPartial(
                'test',
                array('model' => $model),
                false,
                true
            );
        } else {
            $this->render(
                'test',
                array('model' => $model),
            );
        }
}
?>