Blogger Information
Blog 26
fans 0
comment 3
visits 20545
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
TP5项目学习笔记------首页模版输出信息
无意苦争春的博客
Original
667 people have browsed it

      以前看到这些信息很好奇怎么来的,今天终于知道在TP5中是这样来的,做个小笔记,*_*

<table class="table table-border table-bordered table-bg mt-20">
       <thead>
              <tr>
        	 <th colspan="2" scope="col">服务器信息</th>
              </tr>
        </thead>
	<tbody>
	       <tr>
		  <th width="30%">服务器计算机名</th>
		  <td><span id="lbServerName">{$Request.host}</span></td>
	       </tr>
		<tr>
		   <td>服务器IP地址</td>
		   <td>{$Request.ip}</td>
		</tr>
		<tr>
		    <td>服务器域名</td>
		    <!--PHP语句:<?php echo \think\Request::instance()->domain(); ?>-->
		    <td>{$Request.domain}</td>
		</tr>
		<tr>
		    <td>当前PHP版本 </td>
		    <td>{$Think.const.PHP_VERSION}</td>
		</tr>

		<tr>
		    <td>服务器版本 </td>
		    <td>{$Think.const.PHP_OS}</td>
		</tr>
		<tr>
		    <td>当前请求URL</td>
		    <!--传入参数true,显示包括域名的完整绝对URL请求地址-->
		    <!--PHP语句:<?php echo \think\Request::instance()->url(true); ?>-->
		    <td>{$Request.url.true}</td>
		</tr>

		<tr>
		     <td>当前Session数量 </td>
		    <!--这里用原生$_SESSION,TP5无对应方法-->
		    <td>{:count($_SESSION)}</td>
	        </tr>
		<tr>
		     <td>当前SessionID </td>
		    <!--执行原生session_id()方法,因为tp5无对应请求方法-->
		    <td>{:session_id()}</td>
	        </tr>

		</tbody>
	</table>



Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post