Expanding a function to call a module into a custom cms i have built
<p>I have created a simple small cms and in this section of code calls a module (sorta speak) of a poll to my page content which works perfectly however i have come across the need to pass a variable to my include file and I cant figure out how to do it.</p>

<p>Here is working code right now not passing any variables:</p>

<pre class="lang-php prettyprint-override"><code>&lt;?


$pageContent = "&lt;p&gt;Please fill in our poll.&lt;/p&gt; &lt;p&gt; {{poll}} &lt;/p&gt;";

//ENABLE MODULES
$modules = array(
'poll' =&gt; 'mods/poll/poll.php', 

);



//START MODULER
function parseTemplate($templateText, $params){
foreach ($params as $key =&gt; $value)
{
ob_start();
include($value);
$includeContents = ob_get_contents();
ob_end_clean();
$templateText = str_replace('{{'.$key.'}}', $includeContents, $templateText);
}
return $templateText;
}


$params = $modules;
$pageContent = parseTemplate($pageContent, $params);

//END MODULER



print $pageContent;


?&gt;
</code></pre>

<p>I would like to put <code>{{poll?pollID=3}}</code> that way when <code>mods/poll/poll.php</code> is brought into my <code>$pageContent</code> i could load a specific poll.</p>
