即使在这个控制器中,我的所有视图都在我的应用程序中随处可见.当我尝试返回任何视图,包括我可以返回其他地方的测试视图时,我总是在一个空白页面上.我的日志(PHP和Apache)是空的.
调节器
function firstfct($path){ $obj = new Foo\bar($this); $obj->Insert($path); }function ReturnsBlank(){ //Fetching some variables that I was able to dump return \VIEw::make('test'); //Blank //return var_dump('Foobar'); // Returns "Foobar"}
Foo / bar文件
class SomeClass{protected $Listener;public function __construct($Listener){$this->Listener = $Listener;}function Insert($path){ //Some stuff that it is working well return $this->Listener->ReturnsBlank(); } }
test.blade.PHP
<pre> Done!</pre><hr/>解决方法 问题是你的firstfct控制器实际上没有向Laravel“返回”任何东西.视图被’返回’到函数firstfct – 但是你需要传递它
更改
function firstfct($path){ $obj = new Foo\bar($this); $obj->Insert($path); }
至
function firstfct($path){ $obj = new Foo\bar($this); return $obj->Insert($path); }总结
以上是内存溢出为你收集整理的php – Laravel View Make返回空白页面全部内容,希望文章能够帮你解决php – Laravel View Make返回空白页面所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)