I try in Zendframework 2 to call a method in model form layout to show some user specific things. I have tried to do it in Module.php in init and onBootstrap and tried to declare some variables that will be available in layout.phtml, but I failed and have not found anything usefull.
相关问题
- How to dynamically load partial view Via jquery aj
- Why does recursive submodule update from github fa
- How to pass options/params to formCollection field
- Compress html output from zend framework 2
- passing a parameter to the link_to method
相关文章
- Forward request from servlet to jsp
- superclass mismatch for class CommentsController (
- play2 framework my template is not seen. : package
- How to catch exception in flutter?
- Zend Framework 2 Forms Array notation for drop dow
- How to send AJAX data from VIEW to CONTROLLER? (PH
- Backbone fetching data from model vs collection
- How should I create model class to call API (Using
You'd typically use a view helper as a proxy to your model for this
Create a view helper in your application, eg.,
You then make it available by registering it with the framework in your
Module.php
file using thegetViewHelperConfig()
method and an anomyous function as a factory to compose your helper, and inject the model it's expectingFinally, in your view (any view), you can call your helper, which in turn calls your models methods