// 渲染视图       模块@文件/文件名
        // return view('index@index/test');
        // return view('index@test/test');
        // return $this->fetch('index@index/test');

        // 传值给视图
        // $aa = '我是参数aa';
        // $this->assign('name',$aa);
        // // 批量赋值
        // $this->assign([
        //     'name1'=>'libai',
        //     'email'=>'1234567@qq.com'
        // ]);
        // return $this->fetch('index@test/test');

        // 方法传值
        // return $this->fetch('index@index/test',[
        //     'name'=>'lisi'
        // ]);

        // view的传值方式
        // return view('index@index/test',[
        //     'name'=>'liwu'
        // ]);

        // return view('index@index/test')->assign([
        //     'name'=>'liwu'
        // ]);


        // 映射写法
        // $data = '我是数据';
        // $arr = ['id'=>1,'name'=>'wangwu'];

        // $data = [
        //     ['name'=>'libai','id'=>1],
        //     ['name'=>'libai1','id'=>2],
        //     ['name'=>'libai2','id'=>3],
        //     ['name'=>'libai3','id'=>4],
        //     ['name'=>'libai3','id'=>5],
        //     ['name'=>'libai3','id'=>6],
        // ];
        // return view('index@index/test',compact('data'));

 

相关文章:

  • 2021-06-18
  • 2021-08-02
  • 2022-02-25
  • 2022-02-24
  • 2022-01-17
  • 2021-12-05
  • 2021-07-23
  • 2022-02-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2021-09-16
  • 2021-11-09
  • 2021-09-10
  • 2021-08-09
相关资源
相似解决方案