zendframework / zend-expressive-skeleton

Begin developing PSR-7 middleware applications in seconds!
BSD 3-Clause "New" or "Revised" License
136 stars 90 forks source link

Adding Bootstrap and jQuery JS files in Zend\View layout #44

Closed RalfEggert closed 8 years ago

RalfEggert commented 8 years ago

I wonder if it is a bug or done by intention. When the Bootstrap and jQuery JS files are added to the Zend\View layout the headScript() view helper is used.

https://github.com/zendframework/zend-expressive-skeleton/blob/master/src/ExpressiveInstaller/Resources/templates/zend-view-layout.phtml#L73

I think the inlineScript() view helper might be a better choice.

weierophinney commented 8 years ago

@RalfEggert Sounds good; feel free to submit a pull request!

geerteltink commented 8 years ago

I'm not sure why I used headScript(). I think I copied it from somewhere. The reason it's at the bottom is to speed up page loading.

EDIT: I remember now. The reason is that I prefer all JavaScript at the bottom so rendering of the page is not being blocked if you have several JavaScript libraries to load. headScript() does exactly what it needs to do, you could call it footerScript(), but then you might still use the headScript() to add JavaScript libraries. That's why I just use that helper and place it at the bottom.

What I should have done there is add a comment and explain the reason why it is down there.

RalfEggert commented 8 years ago

@weierophinney PR is there

weierophinney commented 8 years ago

Close with #45.