View debugging

Submitted by davestewart - 1 year 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>';
});
comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks