D
D
des1roer2015-04-27 10:51:44
Yii
des1roer, 2015-04-27 10:51:44

Yii renderPartial?

the question is in many ways similar to How to ajax update an element with id="myElem" in Yii?
but there is a specificity - I have static pages displayed in a frame.
how to give the path to the page in render (from another server). of course you need ajax so that the tree is not redrawn
at the moment I have a view

echo CHtml::ajaxLink(
    $text = 'Click me', 
    array('req'), 
    $ajaxOptions=array (
        'type'=>'POST',
        'dataType'=>'json',
        'update'=>'#content',         
        ), 
    $htmlOptions=array ()
    );

controller
public function actionReq() {      
               echo $content = $this->renderPartial('application.views.site.pages.about');

}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
des1roer, 2015-04-27
@des1roer

in general, everything is elementary
in a view

echo CHtml::ajaxLink(
$text = 'Click me', 
array('req'), 
$ajaxOptions=array (
    'type'=>'POST',        
    'update'=>'#content',
    'data' => array( 'id' => '44'),
    ), 
$htmlOptions=array (       
)
);

in controller
public function actionReq() {
 $content = $this->renderPartial('application.views.site.pages.frameset');  
}

frameset.php
$page = $_POST['id']; 
  $page = Page::model()->findByPk($page)->link;    
    echo '
    <iframe id="ifr" src="' . $page . '" align="center">    
    </iframe>';

M
Maxim Grechushnikov, 2015-04-27
@maxyc_webber

what?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question