Zend FrameWork 2 Get ServiceLocator In Form and populate a drop down list

前端 未结 6 1443
没有蜡笔的小新
没有蜡笔的小新 2021-02-02 14:40

I need to get the adapter from the form, but still could not.

In my controller I can recover the adapter using the following:



        
6条回答
  •  情书的邮戳
    2021-02-02 15:27

    The other various answers here generally correct, for ZF < 2.1.

    Once 2.1 is out, the framework has a pretty nice solution. This more or less formalizes DrBeza's solution, ie: using an initializer, and then moving any form-bootstrapping into an init() method that is called after all dependencies have been initialized.

    I've been playing with the development branch, it it works quite well.

提交回复
热议问题