We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53552
    • 2 Posts
    Hi everyone, I'm new here.

    I considered to describe MODx in my engeniering work, everythink goes fine till i face point where i need to describe how MODx assemble page. For ex. when i type in broswer bar adress of my page, whats goin on on this moment. There is called index.php and what kind of other "magic" starts. It's very important for me to get any help in this topic becouse I search much pages and there is no meantion about that and I'm stuck.

    Thanks to good people who bend over the problem.
      • 53161
      • 130 Posts
      Good question. It is an MVC on steroids (i.e. they add another layer "Connector") -> https://docs.modx.com/revolution/2.x/developing-in-modx/overview-of-modx-development/developer-introduction
      Are you familiar with the MVC architecture?
        • 3749
        • 24,544 Posts
        My Book (MODX: The Official Guide) has a section titled "How MODX Delivers a Web Page" that gives quite a bit of detail as it walks through the process. It has about 800 pages of other stuff that you might find useful as well. wink

        Note: the e-book is more up-to-date, but in both versions, the section on the Manager is not completely correct because the Manager has been reorganized a little since either book was written. It's not that difficult to find your way around the new Manager, though.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 53552
          • 2 Posts
          Oh great! Thanks you guys! I checked your's reply and there is a lot of stuff that i looking for in MVC, but about book is hard to pay me for all e-book ;( i just need one chapter. But thank's! I knew something about MVC, and i guest it's do the work to assemble page.
            • 3749
            • 24,544 Posts
            I'll give you the short version for free. wink

            When a request is made, MODX looks for the Resource specified in the URL in the DB. If it finds it, it gets the ID of the Resource's template from the 'template' field of the Resource's DB record and loads the Template (if it can find it). If a publish or unpublish date has been set, and it's time to act on it, MODX publishes or unpublishes the Resource.

            Then, MODX parses all the MODX tags in the Template and replaces them with the result from each.

            Some examples:


            • A resource field tag is replaced with that field from the Resource's DB record (e.g., pagetitle, content, longtitle, etc.).
            • A chunk tag is replaced with the content of the chunk.
            • A snippet tag is replaced with the return value of the snippet.

            • A TV tag is replaced with the value of the TV for the Resource.

            At various points during this process, MODX fires system events (e.g., OnWebPageInit, OnWebPagePrerender,OnOnWebPageComplete). Plugins can be attached (set to "listen for") one or more events. When the event fires, the plugin code executes. The plugin code can alter the page content or perform any other operations (like sending an email, or deleting a file -- anything you can do in PHP).

            When all this is done, MODX returns the finished web page to the browser.



              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting