2008年7月21日星期一

Re: [fw-mvc] How to populate a select form element from a different module/controller/model?

Bryce,

Excellent points, thanks!

I'll check the option to have Zend_Form use that view helper.

Would you actually create a dedicated view helper to retrieve the list of
languages or a more generic/abstract helper, that can load data from
different models (with a lot more complexity)?

Regards, TJ.

Bryce Lohr-2 wrote:
>
> Creating a view helper that uses the Language model to pull the list of
> languages is a perfectly valid solution to this problem. I would assume
> you could then tell Zend_Form to use that view helper to display the
> drop down.
>
> Also, there's no technical reason why models can't access other models.
> Whether you do so or not is entirely up to you and how you want your
> application's architecture to work. It's probably not a good idea to
> force models to depend on controllers to access other models, since the
> whole model layer is better off being completely independent of the
> controllers (or any other code that uses it). Think about what you'd
> have to do if you had to build a CLI version of the application: you'd
> probably need different controllers, which would break many models, but
> you still need the same business logic.
>
> Regards,
> Bryce Lohr
>
--
View this message in context: http://www.nabble.com/How-to-populate-a-select-form-element-from-a-different-module-controller-model--tp18566030p18573653.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: