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).