简体   繁体   中英

Laravel 4 Won't update views content

For some reason, Laravel 4 won't update the content view that should be displayed in the browser.

For example, if I add one more item to the navigation menu, it is written on the view file, but not shown on the navigation list.

I have checked for any mispells, errors or anything related to this issue however I can't figure out if it's my mistake or it has to do with the cache.

What I've done:

  1. Created the route for the url.
  2. The related controller that will render the view.
  3. Created the actual view with the content.
  4. Added the item to the navigation file.

And I am sure that the view:

  1. Extends with my layout
  2. Included my content inside the @section and @stop'ed it.

And there are no errors displayed in the browser.

Also I've checked the storage folder which contains the view's cache , and I verified that the navigation file and the view file are phased correctly.

Looks like I need your advice guys.

Code as requested:

The route

Route::get('/account/profile', array(
'as' => 'account-profile',
'uses' => 'SettingsController@getProfileSettings'
));

Navigation

<li><a href="{{ URL::route('account-profile') }}">Edit profile</a></li>

Controller

public function getProfileSettings() {
    return View::make('account.profile');
}

View

@extends('layout.main')

@section('content')
Edit your profile...

Not yet...
@stop

First things I would do is:

  1. Clear the view's cache folder.
  2. check how you display the navigation, with @yield or @section, which should end with @show in the layout file.

If that didn't work maybe you could provide us with some code from the layout.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM