Laravel 4.2到5.0 - app.blade.php在我的布局之前加载

时间:2015-09-17 08:11:24

标签: php laravel laravel-5 views

我正在从Laravel 4.2升级到5.0。 当我到达主页时,' /' app.blade.php文件加载而不是我的HomeController中指定的文件home.blade.php。我不明白为什么app.blade.php首先加载,我看不到任何命令要求从它开始形成它。

@yield @section等...应该在其他视图中调用也不会加载。

我错过了什么吗?我按照Laravel网站上的说明进行升级,但在任何地方都没有提到。

感谢您的帮助!

编辑代码:

路线:

Route::get('/', array(
        'as'    => 'home',
        'uses'  => 'HomeController@home'
));

RouteServiceProvider:

 <?php namespace App\Providers;

use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;

class RouteServiceProvider extends ServiceProvider {

    /**
     * This namespace is applied to the controller routes in your routes file.
     *
     * In addition, it is set as the URL generator's root namespace.
     *
     * @var string
     */
    protected $namespace = null;

    /**
     * Define your route model bindings, pattern filters, etc.
     *
     * @param  \Illuminate\Routing\Router  $router
     * @return void
     */
    public function boot(Router $router)
    {
        parent::boot($router);

    }

    /**
     * Define the routes for the application.
     *
     * @param  \Illuminate\Routing\Router  $router
     * @return void
     */
    public function map(Router $router)
    {
        $router->group(['namespace' => $this->namespace], function($router)
        {
            require app_path('Http/routes.php');
        });
    }
    }

HomeController:

<?php

class HomeController extends BaseController {

    public function home() {
        return View::make('home');

    }}

0 个答案:

没有答案