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

    I’m working in a module at the moment, and I’m trying to call a Snippet and include two parameters that I want to pass.

    return $modx->runSnippet('orderManagementEmail', $email, $name);


    However when I try and call those two values within the snippet, they appear to be coming up empty.

    I’ve tried the usual method of calling a snippet with parameters inside, [[snippetname? &param1=`param`]] but the module kept complaining about the use of the & symbol.

    Hopefully someone can help!

    Thanks

    Hollie
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Modules don’t use snippets. They contain their own PHP code like any .php file (which they actually are; a module’s .php file is included by the manager’s index.php).
        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
        • 12294
        • 30 Posts
        Hi,

        Thanks for that! I was trying to make the module code a bit smaller, but I can see now that I can always store it in files and call it from there!

        Thank you

        Hollie