D
D
des1roer2015-04-22 13:53:08
Yii
des1roer, 2015-04-22 13:53:08

Yii frame and render?

Maybe I don't understand something. What is the point of the problem.
Let there be a tree of pages, it is drawn in layout in column2, suppose. When you click on a tree link, one or another page should be displayed. Pages are not necessarily made in a framework. Now most of them are just php pages. Accordingly, when I click on the link, I get $content and display frameset.php, which lies in site\pages
Inside this file

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

that is, I give the id of the page. and the frame loads it.
but when clicked, the entire page is reloaded, and I need only the frame to be reloaded, and the tree does not change.
how do they do it in this case?
and, accordingly, a follow-up question - what about pages on yii?
I can't figure out how to display only $content by link.
I look in the direction of render, but it seems like it needs a view and not just a page?
--
a crazy thought appeared - we make ajaxlink map points.
accordingly, we pass id \ url to the controller.
in ajaxoption set update => content. at the same time, the window.location.href(url) script should work in the controller.
well, that's ok bullshit.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
matperez, 2015-04-22
@des1roer

Pages can be displayed and changed via PJAX habrahabr.ru/post/225823/. You will also need a separate action in the controller, which will return a separate page, without an environment through renderPartial or renderAjax.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question