Passing Variables from one functiion to another
<p>I have 4 files. I am trying pass my fetch results through a function to another page. My code is below: </p>

<p>File actions.php </p>

<pre><code>  public function getAction($action, $page, Array $vars){

    if(!empty($action)){
        $action = strtolower($action);

        $path = $page.'/'.$action.'.php';

        $currentTemplate = $this-&gt;loadActionTemplate($path);

        return Array($currentTemplate, $vars);
    }
    else{
        $action = strtolower($action);

        $path = $page.'/default.php';

        $currentTemplate = $this-&gt;loadActionTemplate($path);

        return ($currentTemplate);
    }
}
</code></pre>

<p>File news.php(controller)</p>

<pre><code>$file = VIEWS_PATH.strtolower($this-&gt;template) . '.php';
        if (file_exists($file)){
    $currentQuery = $newsModel-&gt;viewQuery($selectQuery,$returnAll); 
            include_once($file);
        }

    }
</code></pre>

<p>File news.php(Main view) </p>

<pre><code>$factory = new Actions_Factory();


$factory-&gt;getAction($action, $page, $currentQuery);
</code></pre>

<p>File view.php(sub View)</p>

<pre><code>print_r($currentQuery);
</code></pre>

<p>I can't get $currentQuery to print out the mysql dump  on view.php but $currentQuery prints out fine on news.php. I am doing something wrong and can't figure out what it is. </p>

<p>Any help would be much appreciated. </p>

<p>Thanks in Advance</p>
