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


    https://github.com/BobRay/PropertiesToFile (I think you’ll need a GitHub account to see it).

    PropertiesToFile writes the properties of an existing snippet or other element to a valid php file that can be used in a build script. It puts the appropriate phpDoc header in the file and writes the correctly formatted file to the location you specify in the snippet parameters or in the snippet’s default properties. As far as I can tell, it handles all types of properties, including List types.

    I tested it on Formit, and it appears to produce the same file used in Shaun’s _build directory. It’s handy if you prefer to create the properties of an element to be placed in a transport package in the Manager rather than in code. That said, it’s a beta version and I haven’t had time to use it for an actual build script. File an issue at GitHub if you run into any problems.

    Typical usage:

    [[!PropertiesToFile?`
        &packageName = `FormIt`
        &subPackageName = `build`
        &fileName = `properties.formit.php`
        &path = `path/to/directory/`
        &elementName = `FormIt`
        &elementId = `16`
        &type = `modSnippet`
    ]]
    


    To install it, just paste the contents of the snippet at GitHub into a snippet called PropertiesToFile.
      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