CakePHP no layout on back and forward button

江枫思渺然 提交于 2019-12-04 06:21:10

问题


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?


回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!