Within Yii, you're probably looking at a combination. The custom email sending function would probably be best as an extension that you can then call from other controllers with ease. Administering the templates would warrant a model and controller for your CRUD interaction with the templates.
I have a web site that built from the ground up, and im seriously considering transferring this site over to the Yii framework. Im kinda stuck on the "proper" why to do it. I have a few classes that where written for the site. One particular one is an e-mail function that is based on database templates. The class reacts to different actions in the system, pull the info from the DB and fill in e-mail templates that get sent out.
Do i move this email system into the Modules layer? Controller Layer or should it be re-written as an extension?
I have to admit that i am new to MVR and frameworks so any help advice would be appreciated.
2条回答 默认 最新
- 已采纳 dongpeiwei8589 2012-02-27 05:31点赞 评论 复制链接分享
- duanfanta6741 2012-02-27 06:10
The best way would be if you use it as an extension. But for the db operation you will need to create a model and for calling the mail function you will need to create a controller.
By creating an extension you can use this extension to multiple places in your project as you need.点赞 评论 复制链接分享