tp5使用view()在insert.php渲染视图失败,但是在index.php倒是可以渲染insert.html

http://img1.mukewang.com/5de4859c0001123e11390528.jpg

insert页面的代码

<?php   

namespace app\index\controller;

use think\Controller;

use think\View;

class Insert 

{   

   public function insert()

    {

        echo "这是一个insert页面";

        return view('insert',[

            'email' => '1',

            'user'  => 'aaa'

        ]);  

    } 

<?php   



index.php的代码

namespace app\index\controller;

use think\Controller;

use think\Db;

class Index

{   

    public function index()

    {


        return view('insert'); 

    } 

?>

    










慕虎5492763
浏览 1397回答 1
1回答

SilvesterLi

你先把application/config.php 里的debug改为true
打开App,查看更多内容
随时随地看视频慕课网APP