Home > Article > Backend Development > ThinkPHP outputs variables in templates
In the controller
<code> $ao=M('Land'); $base = $ao-> field('base,land')->where($map)->select(); $this ->display();</code>
<code>print_r($base); Array ( [0] => Array ( [base] => 500.00 [land] => 1 ) [1] => Array ( [base] => 400.00 [land] => 2 ) ) //还有很多 </code>
where land is the id of a div in the foreground, and the id is corresponding to the base. For example, a div with land 1 is filled with 500, and a div with land 2 is filled with 400.
The specifics are as follows:
The front desk is a farm made with HTML. Each piece of land has an ID, which is the ID of the land I mentioned above. There will be a box on the land with trees, and the number in the box is the base mentioned above. , the base of each piece of land is different. According to what I wrote above, if you use
In the controller
<code> $ao=M('Land'); $base = $ao-> field('base,land')->where($map)->select(); $this ->display();</code>
<code>print_r($base); Array ( [0] => Array ( [base] => 500.00 [land] => 1 ) [1] => Array ( [base] => 400.00 [land] => 2 ) ) //还有很多 </code>
where land is the id of a div in the foreground, and the id is corresponding to the base. For example, a div with land 1 is filled with 500, and a div with land 2 is filled with 400.
The specifics are as follows:
The front desk is a farm made with HTML. Each piece of land has an ID, which is the ID of the land I mentioned above. There will be a box on the land with trees, and the number in the box is the base mentioned above. , the base of each piece of land is different. According to what I wrote above, if you use
What are you going to do without making your request?
Let me give you an example: if you use width to interpret this thing, it is->
<code><style> <volist name="base" id="v_base"> #div{$v_base.land}{ width : {$v_base.base}px; } </volist> </style> <html> <volist name="base" id="v_base"> <div id="div{$v_base.land}"> 宽度测试 </div> </volist> </html></code>
<code> <div id="{$vo.land}">{$vo.base}</div></code>