【问题标题】:laravel on windows cant find viewswindows上的laravel找不到视图
【发布时间】:2015-07-12 22:09:48
【问题描述】:

您好,我在我的 Windows 电脑上安装了 laravel 4.2,并得到了无法通过 foundet 进行查看的错误

InvalidArgumentException
View [layout.index] not found.

我的控制器内容

protected $layout = 'layout.index';

public function home()
{
    return $this->layout->content = View::make('content_index.home');
}

但文件确实存在 'views/layout/index.blade.php' 它有点错误或什么?

【问题讨论】:

    标签: php laravel


    【解决方案1】:

    文件夹实际上是/layouts,所以你的视图应该位于:

    protected $layout = 'layouts.index';
    

    【讨论】:

      【解决方案2】:

      我的问题是在本地运行后开始的:

      php artisan config:cache
      

      之后我在 vagrant 中运行它并解决问题。

      打开ssh

      php artisan config:cache
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2022-11-29
        • 1970-01-01
        • 2020-01-20
        • 2021-09-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多