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

ThinkPHP初学,请教几个问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-20 12:43:55875browse

我把前端做好的页面拿过来,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!	}}

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

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

Statement:
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