• <small id='bWVfr'></small><noframes id='bWVfr'>

    1. <i id='bWVfr'><tr id='bWVfr'><dt id='bWVfr'><q id='bWVfr'><span id='bWVfr'><b id='bWVfr'><form id='bWVfr'><ins id='bWVfr'></ins><ul id='bWVfr'></ul><sub id='bWVfr'></sub></form><legend id='bWVfr'></legend><bdo id='bWVfr'><pre id='bWVfr'><center id='bWVfr'></center></pre></bdo></b><th id='bWVfr'></th></span></q></dt></tr></i><div id='bWVfr'><tfoot id='bWVfr'></tfoot><dl id='bWVfr'><fieldset id='bWVfr'></fieldset></dl></div>

      1. <legend id='bWVfr'><style id='bWVfr'><dir id='bWVfr'><q id='bWVfr'></q></dir></style></legend><tfoot id='bWVfr'></tfoot>

          <bdo id='bWVfr'></bdo><ul id='bWVfr'></ul>
      2. Zend 框架 - 在呈现布局之前执行的最后一段代码

        时间:2023-05-30
          <tbody id='3D4RW'></tbody>
        • <i id='3D4RW'><tr id='3D4RW'><dt id='3D4RW'><q id='3D4RW'><span id='3D4RW'><b id='3D4RW'><form id='3D4RW'><ins id='3D4RW'></ins><ul id='3D4RW'></ul><sub id='3D4RW'></sub></form><legend id='3D4RW'></legend><bdo id='3D4RW'><pre id='3D4RW'><center id='3D4RW'></center></pre></bdo></b><th id='3D4RW'></th></span></q></dt></tr></i><div id='3D4RW'><tfoot id='3D4RW'></tfoot><dl id='3D4RW'><fieldset id='3D4RW'></fieldset></dl></div>
            <tfoot id='3D4RW'></tfoot>

              <small id='3D4RW'></small><noframes id='3D4RW'>

              <legend id='3D4RW'><style id='3D4RW'><dir id='3D4RW'><q id='3D4RW'></q></dir></style></legend>
                • <bdo id='3D4RW'></bdo><ul id='3D4RW'></ul>
                  本文介绍了Zend 框架 - 在呈现布局之前执行的最后一段代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想在渲染布局之前执行一些代码,然后执行所有其他代码.我会把那个代码放在哪里?

                  我特别想在布局使用 headLink、headScript 和 inlineScript 视图助手中引用的文件之前对其进行修改.

                  以下是我要采取的步骤:

                  1. 循环那些视图助手中的文件
                  2. 列出本地文件
                  3. 从视图助手中删除本地文件
                  4. 将本地文件列表作为参数引用到服务器脚本,该脚本将它们组合起来用于单个 HTTP 请求
                  5. 将新的组合脚本引用添加到适当的视图助手

                  <小时>

                  前端控制器插件似乎不会帮助我实现这一点,原因如下:

                  1. postDispatch() 在执行每个控制器操作后执行,我需要样式表/javascripts 的完整列表
                  2. dispatchLoopShutdown() 在控制器动作循环后执行,但此时布局已经呈现

                  <小时>

                  正如 Rufinus 所建议的,我通过扩展视图助手解决了这个问题.(镜像)

                  您可以通过插件访问的最后一部分应该是 dispatchLoopShutdown

                  ZendFramework2 参见 http://zendframework2.de/en/cheat-sheet.html或 这个 gdoc

                  I want to execute some code right before the layout is rendered, after all other code is executed. Where would I put that code?

                  I am specifically trying to modify the files referenced in the headLink, headScript, and inlineScript view helpers before they're used by the layout.

                  Here are the steps I want to take:

                  1. Loop over the files in those view helpers
                  2. Make a list of the local files
                  3. Remove local files from the view helpers
                  4. Reference the local file list as a parameter to a server script that combines them for a single HTTP request
                  5. Add that new combine script reference to the appropriate view helper


                  It doesn't appear that a Front Controller Plugin is going to help me accomplish this, and here's why:

                  1. postDispatch() gets executed after every controller action that's executed, and I need the full list of stylesheets/javascripts
                  2. dispatchLoopShutdown() gets executed after the controller action loop, but the layout has already been rendered at this point


                  As Rufinus suggested, I solved this by extending the View Helpers. My question from that angle as well as the solution is here.

                  解决方案

                  see Orginal PDF created by Thorsten Ruf (Mirror)

                  the very last part you can access via plugin should be dispatchLoopShutdown

                  EDIT: For ZendFramework2 see http://zendframework2.de/en/cheat-sheet.html or this gdoc

                  这篇关于Zend 框架 - 在呈现布局之前执行的最后一段代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 Javascript/PHP/mySQL 的日历 下一篇:Zend_Cache:加载缓存数据后,字符编码好像乱了

                  相关文章

                        <bdo id='GK8P5'></bdo><ul id='GK8P5'></ul>

                    1. <i id='GK8P5'><tr id='GK8P5'><dt id='GK8P5'><q id='GK8P5'><span id='GK8P5'><b id='GK8P5'><form id='GK8P5'><ins id='GK8P5'></ins><ul id='GK8P5'></ul><sub id='GK8P5'></sub></form><legend id='GK8P5'></legend><bdo id='GK8P5'><pre id='GK8P5'><center id='GK8P5'></center></pre></bdo></b><th id='GK8P5'></th></span></q></dt></tr></i><div id='GK8P5'><tfoot id='GK8P5'></tfoot><dl id='GK8P5'><fieldset id='GK8P5'></fieldset></dl></div>

                      <tfoot id='GK8P5'></tfoot>

                      <small id='GK8P5'></small><noframes id='GK8P5'>

                    2. <legend id='GK8P5'><style id='GK8P5'><dir id='GK8P5'><q id='GK8P5'></q></dir></style></legend>