简体   繁体   English

Laravel 4不会更新视图内容

[英]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. 由于某些原因,Laravel 4不会更新应在浏览器中显示的内容视图。

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. 将我的内容包含在@section中,然后@ stop'ed。

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. 使用@yield或@section检查导航的显示方式,该导航应在布局文件中以@show结尾。

If that didn't work maybe you could provide us with some code from the layout. 如果那没有用,也许您可​​以从布局中为我们提供一些代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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