2012-04-05 8 views
5

나는 Yii에 "보기"페이지가 있습니다.
페이지 캐시로 캐시됩니다.Yii의 동적 렌더링

$this->renderDynamic('renderPartial','view_name'); 

렌더링 된 뷰는 다음과 같습니다 :
지금, 나는 몇 가지 동적 콘텐츠를 삽입 할

<?php some code ?> 
<div>...some html...</div> 

코드는 잘 작동하지만이 오류가 :

<###dynamic-0###>

그래서 나는 html이 반향되는 대신 반향된다는 것을 이해합니다.
나는 renderPartial 함수에 return = true를 전달하려고합니다.
올바른 구문은 무엇입니까?

답변

7

기타 정보 : http://www.yiiframework.com/doc/api/1.1/CController#renderDynamic-detail

  1. 캐시 뷰 파일 :

    $this->renderDynamic('dynamicTest'); 
    
  2. 컨트롤러 파일 (콜백 함수)

    public function dynamicTest() 
    { 
        return $this->renderPartial('dynamicTest', null, true); 
    } 
    
  3. 동적 뷰 파일 :

    ,617,
    echo 'dynamicTest_' . time(); 
    

콜백 함수 (2 단계)에서 반환 값을 추가하는 것을 잊어 버린 것 같습니다.

3

I try to pass the return=true to the renderPartial function. What is the right syntax to do it?

third param of renderPartial는 플래그

$this->renderDynamic('renderPartial','view_name', null, true); 
필요