Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel刀片模板引擎:无法在页面中查看html内容_Php_Codeigniter_Laravel_Laravel Blade - Fatal编程技术网

Php Laravel刀片模板引擎:无法在页面中查看html内容

Php Laravel刀片模板引擎:无法在页面中查看html内容,php,codeigniter,laravel,laravel-blade,Php,Codeigniter,Laravel,Laravel Blade,我正在尝试使用库方法将刀片模板引擎集成到CodeIgniter框架中 以下是我遵循的步骤 1.通过composer下载刀片模板引擎并复制到application/libraries文件夹 2.在libraries文件夹中创建了名为Bladetemplate的类 Bladetemplate.php 3.在我的控制器文件中,我加载了库并调用函数loadTemplate for blade template view public function index() { $thi

我正在尝试使用库方法将刀片模板引擎集成到CodeIgniter框架中

以下是我遵循的步骤

1.通过composer下载刀片模板引擎并复制到application/libraries文件夹

2.在libraries文件夹中创建了名为Bladetemplate的类

Bladetemplate.php

3.在我的控制器文件中,我加载了库并调用函数loadTemplate for blade template view

public function index()
    {
        $this->load->library('Bladetemplate');
       //template object
        $obj=   $this->bladetemplate->loadTemplate();
        $obj->view()->make('test',array('data'=>'test'))->render(); 
    }
在“我的应用程序/视图”文件夹中,存在名为test.blade.php的文件


没有显示任何错误,但页面上没有显示任何内容。某些HTML内容存在。

将视图文件名更改为add.blade。如果查看文件test.php,则将其设置为test.blade.php

而不是$obj->view->make'test',array'data'=>test'->render

您需要使用$obj->view->make'test.blade',array'data'=>test'->render

无论何时使用刀片模板,都必须将视图渲染为刀片类型。那么,测试刀片

我希望它能起作用


如果没有,请告诉我。

Nop它返回view not found exceptionOk。您必须将任何数据传递到视图中吗?可能是因为这个原因,你什么也得不到。我尝试了有数据和没有数据,但在这两种情况下我都会得到空页。你不需要回显渲染吗?另外,您可以转储$views路径。除此之外,我看没有任何问题。
public function index()
    {
        $this->load->library('Bladetemplate');
       //template object
        $obj=   $this->bladetemplate->loadTemplate();
        $obj->view()->make('test',array('data'=>'test'))->render(); 
    }