thinkphp back-end controller inside the method Selectmarks () printf printed HTML code, in the front of the body is not displayed, which master know how to format it

Source: Internet
Author: User
thinkphp back-end controller inside the method Selectmarks () printf printed HTML code, in the front of the body is not displayed, who knows how to format it?
Here is the code://Main address printf start to the end of the printed HTML native code to the front end, the front end is selectmarks.html, inside is blank, I want to introduce a unified Web page style: Bolck inside is defined in the style, So each Web page is displayed with the header of the header of the consistent


Here is the HTML code


Pseudo code at backend: Selectmarks () {
Model



printf (" ");
printf (" ");
foreach ($list as $key + $value) {//role 1 has two module NET login modules
The following is encountered net display, encountered login to display, the encounter will not show other modules
$mid = $value [' mid '];
$marks = $value [' Marks '];
$ro = 1;
if ($ro =1) {
Role 1 has only net and login two modules
foreach ($arr as $k = = $v) {
if ($mid = = $k) {
Module NET login User
printf (" %s
\ n ", $k, ' checked ', $k);
foreach ($v as $key = = $value) {
printf (" %s
\ n ", $value [' Marks '], $marks & $value [' Marks ']? ' Checked ': ', $value [' name ']);

}
}
}
}
}
printf (" ");
$this->display ();

/////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////
My front-end Display page effect and view Web page source effect is as follows
Page Display effect:

View Web Source:





------to solve the idea----------------------
The controllers are combined into variables, via $this->assign (' str ', $STR);
In the template output variable. {$STR}
------to solve the idea----------------------
Why do you have to fix the style and the controls that appear in the controller? A single stored assembly data in the controller, loop in the template,




























numbering name Status Notes Operation
{$one. ID} {$one. Name}

Normal

Disable

{$one. Remark}
Slide
Data list
Move Up
Move Down
Edit
Delete



The name= "Result" is the variable you assign in the controller (that is, the data you want to show).
  • 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.