We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36763
    • 70 Posts
    Hi all,
    I've used ModX since the early fork from Etomite, and it's great to see it progressing to where it is today. Well done to the team. Although, I haven't done a lot in the last few years, so I'm one again getting my head around it all.

    I have a web application that I've written from scratch in php, which utilizes a CRUD system with basic security levels for users and lots of js and several templates depending on what the pages need to do at the time. I have many 'included' files along with the program and many of the files link to each other in weird and wonderful ways, trying to keep authentication all happening correctly along the way.

    Basically, it's a system with many complexities and various pages, like all web applications. There are POSTS, and GETS, AJAX and other 'fun' JS things along the way.

    As it's written in php and js, I'm wondering about the best way, or if I should do this or not, and implement this into ModX. I love the idea of using the security groups in ModX, as it's far superior and more complex than mine and could give room for growth in a huge way.


    If I do go down this path, it could be very ambitious, but I'm not exactly sure what the best practice is to do this kind of thing.


    Bringing in the header and footer templates will be one thing, which I can take care without any problems, but it's more the rest of the site...


    Is it advisable to do one or any of the following methods:

    Import all the files (400+) as chunks with the original code stored in the database and then just reference them through the templates to pull the right code each time?

    Create the same tree and file (document) structure in ModX with all the alias-names using the original referenced filenames, and then using chunks with code like include("originalfilecode.php"); in it?

    Use a .htaccess file to redirect the server to alias-names and give them a .php at the end so the links in the code can find the ones referenced?


    Or, could I just add this code to utilise the user groups and other modx goodies? (as per this page: http://rtfm.modx.com/display/revolution20/Getting+Started+Developing)

    require_once '/absolute/path/to/modx/config.core.php';
    require_once MODX_CORE_PATH.'model/modx/modx.class.php';
    $modx = new modX();
    $modx->initialize('web');
    $modx->getService('error', 'error.modError');


    How about the importing of the static resources via the tools menu?

    Or a complete rewrite?

    Has anyone done this kind of thing before, and if so, what was their implementation? I'm not talking about a backend plugin thing for admins to use, but more of a front end part where clients log in to. Are apps being developed in ModX like this and can/does/is using source code like this a good idea?

    How would/could source control work?

    Big questions, so I'm just curious. Thanks. [ed. note: vrdriver last edited this post 13 years, 10 months ago.]