For THINKPHP frame separation, controller, how to handle the page, please!

Source: Internet
Author: User
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 !! Share To: for THINKPHP frame separation, controller, how to deal with the page, please master 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}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.