Hello everyone,
Is it possible to use a variable to extend a blade view ? My idea was to create blocks and add them into a "application" view and then call the block function.
The block function will then load a block blade view. Now I need to extend the block blade view to the "application" view.
// In application view.
<!DOCTYPE html>
<html>
<head>
{{ Theme::headerBar('_base') }}
// And more....
// In block view
@extends({{$extend}})
<title>@yield('title')</title>
<meta name="description" content="@yield('description')">
// Block function
public static function headerBar($extends) {
$view = new BaseView();
$view->make(self::$viewFolder.'headerBar', array('extend'=>$extends));
}
Can this be done ?
I am not sure what you are trying to do but i assume that you are trying to inject partials to your main view? if so check this out:http://robelluna.com/work/laravel-displaying-different-modulepackage-dashboard-widgets-using-view-composers/
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community