User tests: Successful: Unsuccessful:
This pull request provides a couple of simple examples of using the new MVC for the core.
Right now it's a bit hard for many people to use the new structure because there are not many examples, so this should be helpful as well as being forward looking.
Please can you create a corresponding joomlacode tracker item for this - thanks
Besides refactored components codebase, this Pull Request adds important CMS classes extending new MVC (under /libraries/cms/
) that are essential for refactoring other components to new MVC.
JController
JControllerCmsbase
JControllerHelper
JControllerCheckin
JControllerDisplay
JControllerDisplayform
JControllerUpdate
JControllerUpdatestatelist
JModelCms
JModelCmsform
JModelCmsitem
JModelCmslist
JViewHtmlCms
JViewHtmlCmsform
JViewHtmlCmslist
Apologies for my ignorance in advance but if JControllerUpdateList is CamelCase shouldnt the rest be eg JModelCmslist
@brianteeman sorry, I've made a mistake and it's actually JControllerUpdatestatelist
.
Piotr good catch! Thanks (and also Brian on the camel case). Some of these
have basically been moved to com_config and gotten some improvements and
testing there so there are definitely updates to do. I'm more than happy to
merge pull requests, but then again other people may want to think about
this and could pull and modify the classes.
On Fri, Nov 15, 2013 at 8:17 AM, Piotr notifications@github.com wrote:
@brianteeman https://github.com/brianteeman sorry, I've made a mistake
and it's actually JControllerUpdatestatelist.—
Reply to this email directly or view it on GitHub#1989 (comment)
.
I thinks I'd like to see this PR separated into two:
for reason that it would be easier to contribute to the first one even knowing that refactorings are dependent upon the new MVC.
I wanted to use new MVC in custom component but it was difficult to find this code, I it might be same for other devs. Practically it doesn't make sense to use new MVC for components that contain lists and items without having a finalized CMS extension to new MVC.
Of course, everyone should want to use the new mvc since it is so much
simpler and more powerful, But, what happens is that if you put in classes
and don't use them people say "why are you adding those classes if you are
not using them this very second" so it's really a catch-22. Hence some of
them are in com_config so that could get done and this PR was done with
what are really the two most simple possible extensions in the core CMS.
Also, who knows maybe someone else has thoughts about how to do this. I
think also one of the best ways to figure out what is needed in the real
world is to try refactoring as has been done with com_config and here.
Anyway, although I have a few small things that were never pushed up that
I'll send this week sometime, this is really work for other people to do.
Buddhima is doing great things with com_config.
If you want to pull this down and split it up of course you are more than
welcome to; I do have a few little things to push up. You can always just
register them as your own library if you want them in a component. Lots of
options.
On Mon, Nov 18, 2013 at 5:38 AM, Piotr notifications@github.com wrote:
I thinks I'd like to see this PR separated into two:
- extension to new MVC
- component refactorings
for reason that it would be easier to contribute to the first one even
knowing that refactorings are dependent upon the new MVC.I wanted to use new MVC in custom component but it was difficult to find
this code, I it might be same for other devs. Practically it doesn't make
sense to use new MVC for components that contain lists and items without
having a finalized CMS extension to new MVC.—
Reply to this email directly or view it on GitHub#1989 (comment)
.
Is there any new update of this PR?
I'm interesting of the extended of new MVC and I had intended to do this, but I don't want to redoing same thing if these classes will be merged.
Just a reference, here is the new MVC extended example on my RAD framework "Windwalker":
https://github.com/asika32764/windwalker/tree/staging/Windwalker/Controller
I think we can provides a totally different inner process with same interface of controller, see base Controller:
https://github.com/asika32764/windwalker/blob/staging/Windwalker/Controller/Controller.php
and SaveController:
https://github.com/asika32764/windwalker/blob/staging/Windwalker/Controller/Edit/SaveController.php
Controller separated to 3 process, prepareExecute()
, doExecute()
and postExecute()
, then other controller like ApplyController
can extend SaveController
and change the redirect action in postExecute()
instead use switch
.
All redirect action implement in RedirectController
, if we send hmvc
params to controller, the redirect action will auto closed:
https://github.com/asika32764/windwalker/blob/staging/Windwalker/Controller/Admin/AbstractRedirectController.php#L106
All execute()
return the render result, not output the result, that support the HMVC. Here is a HMVC example in EditController to call CheckoutController:
https://github.com/asika32764/windwalker/blob/staging/Windwalker/Controller/EditController.php#L38
I just provide an inspiration, hope this sample is helpful, thanks.
Other references:
Batch: https://github.com/asika32764/windwalker/tree/staging/Windwalker/Controller/Batch
UpdateState: https://github.com/asika32764/windwalker/tree/staging/Windwalker/Controller/State
Component class: https://github.com/asika32764/windwalker/blob/staging/Windwalker/Component/Component.php
After 6 months with no activity and no joomlacode issue tracker I am closing this.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-07-23 10:40:29 |
Note that this is a work in progress