Home > php教程 > php手册 > thinkphp返回页面方法,非js等方法

thinkphp返回页面方法,非js等方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:38:44
Original
1553 people have browsed it

在后台控制器的方法里记录上一页面的地址,详见【代码段一】 然后在前台的a标签里调用backurl参数。详见【代码段二】 其中”{}“是模板引擎,这个看个人定义了,有的也可能是”“ 我只是提供一个区别于js和jquery的方法,仅供参考。 无 $backurl = empty($_SE

在后台控制器的方法里记录上一页面的地址,详见【代码段一】

然后在前台的a标签里调用backurl参数。详见【代码段二】

其中 ”“  是模板引擎,这个看个人定义了,有的也可能是    ”“

我只是提供一个区别于js和jquery的方法,仅供参考。

$backurl = empty($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], 
           $_SERVER['HTTP_HOST']) ?  '#' : $_SERVER['HTTP_REFERER'];
$this->assign('backurl', $backurl);
Copy after login
<a href="<{$backurl}>">返回</a>
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Why thinkphp has better performance than laravel?
From 1970-01-01 08:00:00
0
0
0
ThinkPHP Why use composer?
From 1970-01-01 08:00:00
0
0
0
thinkphp versions supported by php6
From 1970-01-01 08:00:00
0
0
0
thinkphp upload files
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template