开发者

Joomla - using one model and one view for multiple tasks

I am making a simple component that responds with an XML message.

What I have now is:

controller.php
               models/
                     register.php
                     login.php
                     download.php
               views/
                     users/
                           view.xml.php
                     login/
                           view.xml.php
                     download/
                              view.xml.php

What I want is:

controller.php
               models/
                     users.php

               views/
 开发者_StackOverflow中文版                    users/
                           view.xml.php

The component will perform three operations, login, register and download.

How should I set this up?

ie. controller will have three tasks (login, register and download) How will I get the data to the View? Do I need three models? Should I just output the xml from the controller?


Why not keep your models as those 3 and have a single view? You can call multiple models in a single view. Check this post out.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜