How to pass variables to layout.phtml globally in ZF2?

前端 未结 6 1920
抹茶落季
抹茶落季 2020-12-05 07:21

I want to pass a series of variables to my layout.phtml throughout the whole application(globally). And by that I mean I don\'t wanna use

$this->layout()-         


        
6条回答
  •  失恋的感觉
    2020-12-05 07:33

    Why not use inheritance to abstract repeatable configuration via a base controller that sets the layout variables. Since reuse is the main concern here, basic OOP should suffice. Zend doesn't have to do everything :).

提交回复
热议问题