Page 1 of 1
MVC framework in CMSMS?
Posted: Thu Mar 30, 2006 9:30 pm
by spyro
I have been playing with RoR and like the idea of MVC. I the case of CMSMS I can see the Smarty Pages/CSS/Template as the View. I can see the Tags/Modules as the Model. But I'm not sure where I would put the the controller logic. At this point I am using the Smarty/Page as the controller for form flow. The navigation is part of the Controller I guess.
How are others managing an MVC framework in CMSMS?
- J
Re: MVC framework in CMSMS?
Posted: Fri Mar 31, 2006 3:22 am
by Ted
Modules have an semi-MVC architecture built into them. It's not quite split out in true MVC, but it's close. Your view is each action. The controller is a combination of index.php/moduleinterface.php. The model is the database/adodb.
But it works in the right way. The views decides the logic of the next view that should be displayed. All input/output for those views goes through index.php in the front end, moduleinterface.php in the backend. They know how to direct the viewer to the next proper view, which is the point of the controller. And, of course, the model (while not being nearly as good as activerecord is) is all handled through sql statements and adodb.
Ruby on Rails has spoiled all of us who have used it, that's for sure. I wish PHP was nearly as good...
Re: MVC framework in CMSMS?
Posted: Fri Mar 31, 2006 7:24 am
by Russ
Ted have you seen CakePHP, a RoR like PHP MVC, which is nearing it's first big release like CMS
Here is the main site
http://cakephp.org/
But there is also a wiki, manual, api docs, irc, trac and forge. New website design coming soon. I think it looks quite good.
Russ
Re: MVC framework in CMSMS?
Posted: Wed Apr 12, 2006 12:12 pm
by newclear
I am impressed from cakephp and cmsms like you people!
I cant define is it really possible to integrate cakephp to cmsms before I try to do it, but I thinking on it.
I will start a big project soon and want to know can I play with MVC over CMSMS?
It will be like a game to programming that way.
Re: MVC framework in CMSMS?
Posted: Thu Apr 13, 2006 7:01 am
by Russ
newclear (not a Vapours fan by any chance?)
Anyway, I think you maybe missing the point a bit. You could no doubt incorporate something like Cake or Code Ignitor or even Ruby into a CMS install, but what exactly would be the point. CMS has a load of this stuff already built in and in an accessible form re pluggins and modules? PHP is PHP after all
Whilst on the surface the 'glossy make a web blog in 20 minutes video' is great, real life apps take a lot longer and have a step learning curve. The learning curve for CMS may well be less
I think a common mistake people make is picking up these frameworks with little or no PHP experience because they appear to be able to do a lot with some 'scaffolding' feature. This is true but t does not let you use 'crud' - crud helps you learn! True, if you are an experienced PHP developer then Cake or whatever maybe a very good choice? But the novice maybe better off with something like CodeIgnitor - which is a Framework - but is perhaps slightly more basic but also more transparent so you can see the workings - which can only be a good thing as far as learning is concerned.
Just my thoughts
Russ
Re: MVC framework in CMSMS?
Posted: Thu Apr 13, 2006 11:24 am
by Ted
I've been looking at cake on and off for the last couple of weeks. It's intreguing, if anything...
There are a hundred ideas I have that would be easier if CMSMS were using a framework like this instead of doing everything by hand. Just with it's object oriented nature I could do a lot of neat tricks with module id's and stuff. Or having an built-in MVC framework would make module developmen easier. etc.
It makes my mind race, that's for sure. But, alas, I should probably concentrate on what we have instead of looking at total rewrites.

At least for now...
Re: MVC framework in CMSMS?
Posted: Thu Apr 13, 2006 3:37 pm
by newclear
I am self-studing programmer and not close to MVC but I like MVC because of the design pattern and the technical approach. I only read the cakephp documentation but before I try the cake I was worked on other projects with my hand-maded classes. My goal was to safe my time while creating repeated blocks used in my applications.
but that is possible without MVC so I will start digger cmsms modules like Ted said

Re: MVC framework in CMSMS?
Posted: Fri Apr 14, 2006 7:42 am
by Russ
I've been looking at Cake as well, with a test project - which I just can't seem to get working

. Cake seems very quick to get up to a working model with the scaffold, but after that, to do more complex stuff seems to require a steep learning curve. To be honest, to feel comfortably with any framework/language it has to 'click' for you, Cake just hasn't yet. Some never do !
I'm going to try the same test project in CodeIgnitor and see how that goes. I'll let you know.
Either way it won't stop me writing plugins for CMS if I need them and I will still use CMS as my usual way for producing client web sites - as they say about Apple Macs, 'it just works'
Russ
P.S. There is another thread on a similiar theme on which I've also posted some comments....
http://forum.cmsmadesimple.org/index.ph ... 145.0.html