Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Laravel blade templates #17

Open
jszobody opened this issue Feb 16, 2016 · 0 comments
Open

Support for Laravel blade templates #17

jszobody opened this issue Feb 16, 2016 · 0 comments

Comments

@jszobody
Copy link

Have you considered writing an extended Laravel ViewFactory, that would first parse all blade templates for metadata before handing the content back to Laravel for normal handling?

I can think of a number of cases where I might want to allow views to offer up some config, and access that in the controller.

public function myControllerFunction()
{
    $view = view('my.page');
    if($view->getMetadata()['foo'] == 'bar') {
        doSomething();
    }

    return $view;
}

my/page.blade.php:

{
    "foo": "bar"
}
===
@extends('layouts.main')
@section('content')
    The rest of my normal blade template
@endsection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant