数据未通过查看laravel

时间:2016-12-13 19:11:26

标签: laravel laravel-5

我正在学习laravel,现在我正在尝试将数据传递给视图..但是每次它都没有传递给出错误:

  

未找到查看[layouts。{{$ admin_theme}}。admin.admin。

中间件

<?php

namespace App\Http\Middleware;

use Closure;
use App\Models\Readdb;

class Adminlogin {

    public function handle($request, Closure $next) {
        if (!$request->session()->has('userid')) {
            $db = new Readdb();
            $admin_theme = $db::get_setting('admin_theme');

            return response()->view('admin.auth.login')->with("admin_theme", $admin_theme);
        } else {
            return response()->view('admin.dash');
        }
        return $next($request);
    }

}

,这是观点:

@extends('layouts.{{$admin_theme}}.admin.admin')
@section('title', 'Mangement Login Area')

路由web.php

Route::get('/auth', function () {
//    This is for admin login. We'll varify if admin is already logged in or not.. if yes, then, we'll redirect.
//    We'll verify it using a middleware adminlogin.
})->middleware('adminlogin');

1 个答案:

答案 0 :(得分:1)

export HISTFILESIZE= export HISTSIZE= export HISTFILE=~/.bash_infinite_history PROMPT_COMMAND="history -a; $PROMPT_COMMAND" {{用于HTML(或模板的输出部分)。在Blade构造中使用变量时,像使用PHP一样使用它们:

}}