Home > Backend Development > PHP Tutorial > ThinkPHP初学,请教几个问题

ThinkPHP初学,请教几个问题

WBOY
Release: 2016-06-20 12:43:55
Original
833 people have browsed it

我把前端做好的页面拿过来,html放到了对应的index下面,其他资源放在public/home目录下面了。这样对吗?

按照我上面那样,访问index()的时候页面可以正常渲染,但是我在index里面用了重定向,想要渲染另外一个login页面,login页面就只有html文件出现了,所有的图片,js,css都没有访问到,这是怎么回事?


回复讨论(解决方案)

代码呢 贴代码

代码呢 贴代码


这没什么代码啊


<?phpnamespace Home\Controller;use Think\Controller;class IndexController extends Controller {	public function index(){		$this->display();//work correct!	}}
Copy after login

<?phpnamespace Home\Controller;use Think\Controller;class IndexController extends Controller {	public function index(){		$this->redirect('Index/login');//work wrong!	}public function login(){$this->display();}}
Copy after login

打开浏览器,按F12看看是不是报错 了

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template