For details about how to handle THINKPHP frame separation, controller, and page, please give me some advice !! For THINKPHP & nbsp; split the page into three frames, & nbsp; controller, how to handle the page, please give pointers !! Or give a link !! For details about how to handle THINKPHP frame separation, controller, and page, please give me some advice !!
For details about how to split the THINKPHP page into three frames: Controller and page, please give us some advice !!
Or give a link !! Share:
------ Solution --------------------
I guess the page is composed of three modules. Each module has an independent controller and a rendered page.
You only need to get the html string rendered by each controller and pass it to the front end by the controller of the entire page.
------ Solution --------------------
... Reference these models in your program and then query them with the model.
You can even define a method in the referenced models and then use the method to get the result directly.
$mod=M("user");
$mod -> getlist(10);
------ Solution --------------------
IndexController:
// Obtain the most viewed articles
$ Datanews = getreadmore ();
$ This-> assign ('data', $ datanews );
$ Tag_morenew = $ this-> fetch ('public: tag_morenew ');
$ This-> assign ('tag _ morenew ', $ tag_morenew );
// Weibo show
$ Tag_weiboshow = $ this-> fetch ('public: tag_weiboshow ');
$ This-> assign ('tag _ weiboshow ', $ tag_weiboshow );
$ This-> display ();
Tpl: corresponding template parsing
Tag_morene1_html
Tag_weiboshow.html
------ Solution --------------------
Tpl的index.html
{$ Tag_header}
{$ Main}
{$ Tag_article}
{$ Newtype}
{$ Tag_morenew}
{$ Tag_weiboshow}
{$ Tag_footer}