title: Wrapping Wayfinder Menu in Modx: How to pass all vars (general PHP question, perhaps)
body: <p>I have made a tiny ModX snippet that looks like this</p>
  
  <pre><code>&lt;?php
  $theMenu = $modx-&gt;runSnippet('Wayfinder',
   array("startId" =&gt; 0, "level"=&gt;1)
  );
  echo $theMenu;
  ?&gt;
  </code></pre>
  
  <p>but I would like it to pass ALL params it receives to Wayfinder. I will only be modifying the "level" parameter from my snippet. </p>
  
  <p>Is there any way, without naming all the relevant variables individually, to cycle through all the currently SET variables in PHP?</p>
  
  <p><strong>Edit</strong>: I don't think that get_defined_vars is the right way to go, as it gets too much stuff. This trivial PHP page prints out the number 14, for instance:</p>
  
  <pre><code>&lt;?php
  echo count(get_defined_vars()); 
  ?&gt;
  </code></pre>