teepluss / laravel-theme

Theme and asset managing for laravel
MIT License
546 stars 132 forks source link

writeScripts #35

Closed garatortiz closed 10 years ago

garatortiz commented 10 years ago

I have a question. In the config.php file of my theme I declare the scripts and styles that are loaded before rendering it.

Some views have individual scripts. The online writing, so I'm using 'writeScript' to do. My query is about good practice, I should declare the function within the controller or the view itself?

That is, within the function do $ this-> theme-> asset () -> container ('inline-script) -> writeScript (' inline-js', '..........') , before undertaking the renderer of view, or at the view itself to Theme :: asset () -> container ('inline-script) -> writeScript (' inline-js ',' ........ .. ');

teepluss commented 10 years ago

In your view use this .

Theme::asset ()->container ('inline-script')->scripts();