Question

I am trying to figure out a way to load my css files, in the master blade just before master blade is called initialized.

What i want to achieve is following. I will have a let say a MasterClass

Posts Controller:

  public function show(){
    MasterClass->load_css_file('styles.css');
    return View::make('master')->with('data','Post Data');
  }

/Now this styles.css should be available on a global level so that i can read it, or share it with view::share(); The reason i am not loading all the css files in the template is that each functionality might have its own css file to be loaded. Think of it as a plugin. A plug in might have its own css files, js and other object so i want to inject those without changing master template/

I am aware of return View::make('master')->with('css','styles.css'); This doesnt help.

How can i make these css files, and other variables to be available through out my app, just like laravel app(), and to be available in my closures as well??? As every time i will instantiate a new object. Its a new object everytime of MasterClass with no values.

Hope i could make my point.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top