We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22098
    • 218 Posts
    Hello,

    we are planning on writing a lot of custom modules for MODx, and i was wondering if it’s possible or usefull to use PHP application frameworks like CakePHP or Code Igniter for MODx modules? Or maybe if it’s possible to better wait for MODx 1.0 ?

    cheers, Olaf
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: olafmol at Mar 18, 2007, 12:10 PM

      Hello,

      we are planning on writing a lot of custom modules for MODx, and i was wondering if it’s possible or usefull to use PHP application frameworks like CakePHP or Code Igniter for MODx modules? Or maybe if it’s possible to better wait for MODx 1.0 ?

      cheers, Olaf
      Olaf, IMO, if you wait for 0.9.7, you will be able to take advantage of the new object-oriented core engine and the xPDO ORM layer to build robust custom modules, and/or easily integrate Code Igniter or Zend_Framework libraries with the new core engine (not so sure about CakePHP, as I’m not familiar enough with how the controllers are coupled with the libraries). That’s not to say you couldn’t do so now, but you will have more options and it will be that much easier to achieve with the new engine. Alternatively, you could also use xPDO with current MODx versions to build custom modules now, but since xPDO and MODx 0.9.7 are still in alpha stages, it may be better to wait just a little longer until the API’s are frozen for public beta releases, and be able to take advantage of the xPDO-based MODx API’s.

      Just curious, what is causing you to consider CakePHP and/or CodeIgniter as frameworks to be used within the MODx framework?
        • 22098
        • 218 Posts
        Quote from: OpenGeek at Mar 18, 2007, 12:52 PM

        Just curious, what is causing you to consider CakePHP and/or CodeIgniter as frameworks to be used within the MODx framework?

        Personally, i see MODx as a very good CMS-framework, but not as an PHP application framework (yet). We are extending MODx with a lot of modules for our customers needs, and we try to do this as structured and smart as possible, ie mainly trying not to reinvent the wheel again and keep things as easily scalable and expandable as possible. We greatly believe in the powers of a good MVC-based framework, and thus we would love to see this as the base or integrated into MODx. In my view the perfect setup would be that the MODx CMS-framework is build on a goodquality MVC-based PHP application framework (as logically a CMS is an application) and thus enables powerdevelopers to make use of both the PHP-framework for php-application, and the MODx CMS-framework extensions of the underlying MVC-framework for more CMS-oriented parts.

        I hope this makes some sense? smiley

        Olaf
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          As I said once before, MODx as it is now is a CMS with a framework for building modules and applications. The new xPDO core will turn this on its head, and be a framework with a CMS as a module. From what I understand (very poorly as yet, these things take me a while) the xPDO framework is usable, although it is still under heavy development.

          http://xpdo.org/
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 22098
            • 218 Posts
            Quote from: sottwell at Apr 22, 2007, 11:23 AM

            As I said once before, MODx as it is now is a CMS with a framework for building modules and applications. The new xPDO core will turn this on its head, and be a framework with a CMS as a module. From what I understand (very poorly as yet, these things take me a while) the xPDO framework is usable, although it is still under heavy development.

            http://xpdo.org/

            maybe i don’t understand it all to well, but isn’t xPDO mainly aimed at database-transactions and having data-objects, and are frameworks like cakePHP and code igniter much more extensive?

            Olaf
              • 33101
              • 46 Posts
              The project I am working on is using these two tools (modx and CI) and each have their strong points. But after having developed an application in CI and having developed a simple view in modx (taking the database for a online catalog and displaying all the components - accessories, swatches, etc.) It’s clear that there are some big pieces missing for me to use modx more for applications (and like it).

              The biggest piece I need is a powerful templating/view system - php is fine and/or a way to pass complex data (assoc arrays/objects) to the view. if I have a <ul> list of elements, I shouldn’t have to make that html in my snippet (Even with chunks - if I have 15 different components - how many chunks do I have to have - just for one page - when I go do all the same logic with one page of php and some associative arrays/objects) If anyone can explain how I could do this in modx I would be grateful.

              look at the http://codeigniter.com/user_guide/ for an overview.
              and the last project I did used www.rapyd.com extensively. very handy for getting things done fast.

              Looking forward to the upcoming releases..
                • 22098
                • 218 Posts
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Quote from: olafmol at Apr 22, 2007, 03:17 PM

                  maybe i don’t understand it all to well, but isn’t xPDO mainly aimed at database-transactions and having data-objects, and are frameworks like cakePHP and code igniter much more extensive?
                  Well, xPDO is an object-relational bridge, which will allow you to write applications that are portable to (and optionally optimized for) any relational database engine. It focuses on one general area that is or will soon be covered by CI (Active Record, OR/M, database abstraction).

                  The code xPDO generates for you represents a model in a typical MVC framework, and provides both a way to interact with the persistent data of an application, as well as a domain model that represents a baseline API (i.e. scaffolding) for interacting with the application data. This scaffolding can then be used for quick and dirty access to that relational data in an object oriented way, and/or quickly extended with domain logic (i.e. business logic, business rules) to provide a complete, robust model which MODx, or any "reasonably well designed PHP application"1 can utilize to access, interact with, integrate with, or extend your application.

                  Other than the obvious benefits of a database abstraction layer, the real benefit of xPDO IMHO is the balance I’ve been striving for between maintainability and optimization. For instance, the ability to change the application over it’s life-cycle without forcing add-ons, integrations, and extensions to be rewritten everytime (i.e. when SQL statements have to be updated because database table structures are modified) is a key factor as I’ve been re-building MODx with xPDO itself. But the existing solutions I found did not factor performance into the equation enough, because database performance can quickly become the primary scalability bottleneck for any PHP application. That point and having the ability to support PHP 4 for a bit longer were the deciding factors when I chose to reinvent the PHP OR/M wheel with xPDO just over a year ago.

                  1 - A "reasonably well designed PHP application" refers to one written with portability, integration, and respect for PHP’s single global namespace in mind.


                  Quote from: yehosef at Apr 24, 2007, 02:35 PM

                  The project I am working on is using these two tools (modx and CI) and each have their strong points. But after having developed an application in CI and having developed a simple view in modx (taking the database for a online catalog and displaying all the components - accessories, swatches, etc.) It’s clear that there are some big pieces missing for me to use modx more for applications (and like it).

                  The biggest piece I need is a powerful templating/view system - php is fine and/or a way to pass complex data (assoc arrays/objects) to the view. if I have a <ul> list of elements, I shouldn’t have to make that html in my snippet (Even with chunks - if I have 15 different components - how many chunks do I have to have - just for one page - when I go do all the same logic with one page of php and some associative arrays/objects) If anyone can explain how I could do this in modx I would be grateful.
                  The new object-oriented, xPDO-powered core will be introducing some very cool ways to deal with complex data in your MODx views, as well as more flexibility in templating, including allowing traditional PHP files to be easily included, and allowing alternate templating engines to handle all or part of your content. For now, you can easily include traditional PHP files by creating a snippet that includes that file within an output buffer and returns the output. See code in this post for an example of how to use traditional PHP files as MODx Templates; this would work equally as well for snippets...
                    • 4971
                    • 964 Posts
                    How does XPDO compares with QCodo?

                    Can it be possible to design the db model, run it through QCodo generator
                    and the hook it to MODx for the presentation layer?
                      Website: www.mercologia.com
                      MODX Revo Tutorials:  www.modxperience.com

                      MODX Professional Partner
                      • 22303 MODX Staff
                      • 10,725 Posts
                      QCodo and xPDO essentially have the same basic goal at the data layer, though QCodo also extends into presentation a lot more than xPDO does. I have not used it myself so I will not compare and contrast them at this point, but I will say it was not selected for the next-generation MODx framework due to it’s dependency on PHP 5, and because there was no "obvious" separation between presentation layer and data model. From the little I do know of it, it may be too focused on presentation and the data layer might suffer from a lack of flexibility or an excess of unnecessary code, but I would have to explore it in detail and use it to build something in order to make any further judgements or comparisons.