douji1058 2016-06-11 12:44
浏览 100

为什么显示数据库结果不起作用?

I have a header.blade.php in an includes folder, this header page is the whole webpage base. i have links on it and i have the header of the website which is included in all other web pages.

The heading part i want to retrive just the first line of the table result in it so the admin can update that line whenever possible.

The thing is that it is hard to figure out a route to give to it as it is a partial page.

The code on it is:

<div class="site-heading" data-webid="{{ $web_header->id }}>
<h1>{{ $web_header->header }}</h1>
<hr class="small">
<span class="subheading">{{ $web_header->slogan }}</span>
</div>

My home controller has the following code to display in the information on the header partial page:

public function showWebHeader()
{
 $web_header = WebHeader::all()->first();
 return view('include/header', [
  'web_header' => $web_header
 ]);
}

I am lost and confused here because I keep getting undefined variable on every single page I have on my web system.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 mmocr的训练错误,结果全为0
    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀