Answer the question
In order to leave comments, you need to log in
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 ()
);
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
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 (
)
);
public function actionReq() {
$content = $this->renderPartial('application.views.site.pages.frameset');
}
$page = $_POST['id'];
$page = Page::model()->findByPk($page)->link;
echo '
<iframe id="ifr" src="' . $page . '" align="center">
</iframe>';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question