Zend Framework and QCodo Hybrid?

thread: 10 messages  |  last: about 10 years ago  |  started: tuesday, april 18, 2006, 2:45 pm pdt

#1  |  InSense (New York, NY)
Tuesday, April 18, 2006, 2:45 PM PDT

I was looking at the Zend Framework and I really like their MVC approach. Its very clean and produces search engine friendly URLs which my marketing dept will love.

I also really like QCodo, especially the QForms library.

Can anyone see any problems that might come up using the frameworks side by side? (The Zend Framework for MVC and QCodo for data objects / form generation)

#2  |  Mike Hostetler (Denver, CO) United States of America Qcodo Administrator
Wednesday, April 19, 2006, 1:11 PM PDT


Hit me up via email <http://www.amountaintop.com/feedback>, I might have what you are looking for.


#3  |  Lionel Tressens (Toulouse, France)
Thursday, April 20, 2006, 6:53 AM PDT

escape164, if nothing confidential in your solution, I think that a public response may interest a lot of people here, rather than giving it in a confidential way.


#4  |  Mike Hostetler (Denver, CO) United States of America Qcodo Administrator
Thursday, April 20, 2006, 7:55 AM PDT


Great point.  The reason for my “confidnetial” approach is not to keep the benefit of my solution away from the community.  On the contrary, I cannot wait for the time when I can release it.

Unfortunately, the reasons behind my secrecy are not my own.  My personal solution to a Zend Framework & Qcodo linkup are due to ensuring that I am not violating any licensing laws.  I currently work as a PHP contractor and sign contracts governing the ownership of the code I produce.  I'm currently nailing down the specifics of what I can release with my employer.  Until that happens, I feel it is unfair to release my code with the chance that somebody actually owns it.

Now, I do know that Qcodo and the Zend Framework are both open source.  They cannot be controlled by any single party.  However, the code I produce that binds the two together is not open source and does not modify either project.  This is the code in question.

Thanks for pointing this issue out.  I will post back here when I can about where this is going.

In the meantime, here's what I've got so far.

Dealing with the “Controller” issue in Qcodo
As you probably know, Qcodo does not have any structured Controller.  Mike Ho has built up the individual pages and each could be considered a controller, but nothing that binds an entire project together.  I'm involved with the Zend Framework team a bit, the Drupal CMS project and also Qcodo.  Each project fills a different need IMO.  Therefore, I've written a Drupal module that binds all three together.  

I've got a ALPHA release which I've already sent to Mike Ho and a few other people.  At this point, the module can codegen the basic form drafts from within Drupal, offer up all the functionality through Drupal and also provide a REST interface to all of the Qcodo objects through Drupal.  The Zend Framework is currently an addon that is available.  I chose to use Drupal as my controller piece because it brings so much  more to the table than just a controller.  Software I create requires authentication, role based permissions and the ability to add static HTML pages to the site quickly and easily.

I would hope that the Zend Framework matures enough for it to be used as a controller soon, but in my opinion it is not there yet.

#5  |  Mike Ho (San Diego, CA) United States of America Qcodo Administrator
Friday, April 21, 2006, 1:03 AM PDT

Of course, i'd be very excited to see how people are using Qcodo, especially as they integrate it with other frameworks as needed, including Zend's.

Specifically in terms of the Qcodo “Controller” layer -- Qcodo actually supports both page-level and site-level controller support.  In short, if there is anything that you need at the controller level site-wide, you can simply implement that logic in the /includes/qform/QForm.inc class.  You can implement global methods, as well as implement your own Form_Run, Form_Load, etc., methods, which would then be used on every page that is run.

(The only caveat to this is that when you actually code your specific form instances, you need to be sure to call parent::Form_xxx() in your Form_xxx() methods.)

#6  |  Mike Hostetler (Denver, CO) United States of America Qcodo Administrator
Friday, April 21, 2006, 5:23 PM PDT


Good thoughts here.  However, while I definitely like the idea of the site-wide Qcodo controller and the way it's been done, it probably isn't very easy for other people.  I went the Drupal route mainly because I wanted to leverage the power of an existing CMS system.  Perhaps some additional tutorials about the site-wide controllers would help.

#7  |  Riccardo Tacconi (Leamington Spa, UK) United Kingdom
Wednesday, October 8, 2008, 4:18 AM PDT

I think that a tutorial on how to integrate drupal and Qcodo wuold be highly important for Qcodo and its developers. There should be a discussion to decide which web site wide controller to adopt for Qcodo.

#8  |  Shahways Romani (Antwerp, Belgium) Belgium
Thursday, October 9, 2008, 8:26 AM PDT

Not in any way trying to promote my work here, but take a look at <http://www.buzzouka.com/blog>. I know that it is not “the perfect” MVC solution, but I think I'm getting quite close.

In the classic MVC pattern, you have a single class file that represents your controller such as “blog”, and actions are methods defined in that class, such as add, edit, view, readpost, comment, etc.

In my setup,  my controllers are directories, and I use individual QPanel class files for every action.
This keeps my files small, and allows me to keep things seperated, which I like.

Recently I've come up with the next step, and designed a class called QController that extends Qcodo's QPanel class.
For my blog controller, I can simply extend QController (BlogController extends QController). I still retain my approach to have seperate classfiles for each action, but instead of having my blog actions (add, edit, etc.) extend QPanel, I get them to extend BlogController. This allows me to put controller specific login into BlogController, so every “blog action” can reuse this shared logic.
If you would for example have an admin backend, you could come up with AdminController. In the constructor of the AdminController, you could for example verify that the concerned user has admin access, since this will normally be required for all actions in the admin controller.

I could see the same happening with QApplication or QForm, being extended into new classes that could become site-wide controllers for your projects. This could be handy for functionality required on every page, such as authentication, statistics, or whatever else you can think off.

Bottom line .. I'm not writing this to promote my work. I actually couldn't care less if anyone uses my ideas or not.
My blog series might not be the perfect answer or solution to every of your questions, problems, projects and challenges that you face while working with Qcodo. But it should provide you with a good idea of the extent up to which you can customize Qcodo, in order to obtain a RAD environment for the type of projects that YOU do.

People really need to realize that Qcodo is a diamond in the rough, allowing you to cut and polish it the way you want!

#9  |  erikwinn (Portland, OR)
Thursday, October 9, 2008, 10:09 PM PDT

Shahways - thanks for your efforts; Its great to see some people really giving QCodo a work out and providing some examples. I agree with you, people just need to see the diamond in the rough that I found when I stumbled across a reference to QCodo in a forum somewhere ..

You mentioned:
“I could see the same happening with QApplication or QForm, being extended into new classes that could become site-wide controllers for your projects. This could be handy for functionality required on every page, such as authentication, statistics, or whatever else you can think off.”
I encourage you to browse the QuasiCMS code - this is exactly what it does.

#10  |  Shahways Romani (Antwerp, Belgium) Belgium
Friday, October 10, 2008, 3:33 AM PDT

Hey Erik, thanks for pointing this out ... I promised already a long while ago to take a look at your efforts on QuasiCMS, but haven't found the time yet to submerge myself in it ... I hope I can take a look ASAP, since I have a feeling that we're both trying similar approaches to the same challenges, and hopefully can learn from each other!

Copyright © 2005 - 2019, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.