View debugging

Submitted by davestewart - 2 years ago

A couple of view creators that inject variables or text into views

// inject $viewName variable into  views
View::creator('*', function ($view) 
{
    View::share('viewName', $view->getName());
});

// debug view name in views
View::creator('*', function ($view) 
{
    echo '<pre class="debug viewname">' . $view->getName() . '</pre>';
});

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks