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

    It took me an hour to find that something like $modx->virtualDir exists. Is there a place where I can find all these goodies?

    I tried var_dump($modx) but got a memory error even if I increased the php memory to 80M. Should I go higher?

    Thx
      • 22303 MODX Staff
      • 10,725 Posts
      Use the source xpix... wink

      ...or var_dump specific variables of the $modx object for inspection. There is way too much to see if you dump the entire object, though you can certainly keep raising your memory limit if you really want to go through the whole dump...

      FWIW, just be aware that much is changing in 0.9.7 and many of the variables and functions that are not documented on the site or the wiki, are not intended for "public access"; virtualDir is one of them and why I brought this up. In other words, it’s not a good idea to depend on them in your components or you will have to refactor them if/when you decide to adopt one of the future releases.

      There will be very clear API documentation for 0.9.7 and beyond to make it much easier to get started developing MODx add-ons and core extensions.
        • 5340
        • 1,624 Posts
        undecided
        Since I am using friendly URLs and need to pass to flash /name1/name2/name3, is there a better way to find this information?
        ...Except parsing the URL which is not the case since this information should be found in a modx variable(IMHO)

        Thx
          • 22303 MODX Staff
          • 10,725 Posts
          Everything should be relative to the index.php as far as Flash is concerned; perhaps I still do not understand exactly what you are trying to do, but getting the url is as easy as calling $modx->makeUrl($docId), and then getting dirname() of that is just as easy, but feel free to use the virtualDir variable for that if you really need to. Just realize that all requests in MODx are treated as relative to the root as far as any external resources are concerned, and not relative to the virtualDir.
            • 5340
            • 1,624 Posts
            I’m not using the VirtualDir value for paths. It’s used to set a state of the flash menu depending on the page you are on

            I will have a look at $modx->makeUrl($docId)

            Thank you