上記のようなモジュール構造を持つZendFrameworkMVCアプリケーションがあります。
/application
  /layouts
    /sripts
      /layout.phtml
  /modules
    /default
      /controllers
        /IndexController.php
        /OtherController.php
      /views
        /scripts
          /index
            /index.phtml
            /second.phtml
            /third.phtml
            /fourth.phtml
          /other
            /index.phtml
            /second.phtml
            /third.phtml
            /fourth.phtml
私のlayout.phtmlに行があります
<div id="main">
    <?= $this->layout()->content ?>
</div>
レンダリングされたアクションビューを、4番目を除くIndexControllerとOtherControllerのすべてのアクションで、最初とレンダリングされたアクションビューの最後などのコードでラップしたいと思い<div id='top'></div>ます<div id='bottom'></div>。すべてのアクションビュー*.phtmlファイルで手動で実行したくありません。実際のアプリケーションには多すぎるだけでなく、そのソリューションではコードが乱雑に見えます。
どうやってするの?