jeudi 28 septembre 2017

Access blade variable as php variable in template

Working on a project using Blade 5.1. I know this isn't best practice as blade should just take care of view data. However, I need to template out a section that is in the master template. The master template has something like this:

<?php

function q($q) {$q['meta'] = @yield('meta');return $q;}
add_filter( 'document_title_parts', 'q' )

home.blade.php

@extends('layouts.master')

@section('meta')
    Hello world
@endsection

My question is, is it possible to access the section meta value passed in to the master template as a php variable? In simple terms, the goal here is to set $q['meta'] to 'Hello world' successfully.

Thanks in advance



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2fssZL8
via IFTTT

Aucun commentaire:

Enregistrer un commentaire