How to get the absolute path of the blade from View?

0

Laravel 4.2

I need to get the full .blade directory after rendering, how do I do that?

I've been trying to navigate through the Application, this seems to be a bad idea, but I have not found any native methods that do this.

dump(app()->__get('view')->getFinder());
    
asked by anonymous 16.07.2018 / 16:39

1 answer

0

Create a Filter so that the View name becomes available on it.

filters.php

/**
 * Compartilha a globalmente variavel $view_name com o nome da view corrente
 */
View::composer('*', function ($view) {
    View::share('view_name', $view->getName());
});

From this, you can use $view_name in any View.

    
16.07.2018 / 17:57