We're building a large CMS in CakePHP with a Croogo install incorporated. We've run into an issue recently where the layout is not rendered correctly when users click the back
in the browser (or the forward
button for that matter).
What you end up with is the view (.ctp) file using the blank
layout, so no styles, js, etc. Any input or ideas would be much appreciated. Thank you!
FYI: modern browsers should cache the page request (cache is enabled), so we're looking at the Auth stuff coz it seems like the first thing that would be called for pages (even cached ones), correct? :S
Also: if the browser is left standing for a few mins and then we click back and forward again, the pages render as expected with the correct layout?!? Session timeout?
Solved. This issue was being caused by a bit of javascript that was called in an include in the footer of the default layout.
The solution on this thread was the cause of our headache: jQuery .each loop string or object
来源:https://stackoverflow.com/questions/12403851/cakephp-no-layout-on-back-and-forward-button