passing an array/data from one function to another

I have a search function that will skinny down data and display it to a grid. Then the users will have the ability to replace a specific field based on the skinnied down data. Is there a way to pass data/arrarys from one function to another.

Code example below

[php]function search(){
$this->set(‘lookforme’, $this->User->find(
‘all’,
array(
‘conditions’=>array(‘last_name’=>$_POST[‘search_user’]),
‘fields’ => array(),

  'order' => 'id DESC' 

)

)); [/php]

.ctp

[php]<form method=“POST” action="<?php echo Configure::read(‘my_app_dir’).
“/test/mmarshall/TEST-PHP/new/users/search/”; ?>">
Search current e-mail with:



<?php echo $html->tableHeaders(array_keys($knownusers[0]['User']));

foreach ($knownusers as $thisuser)
{
echo $html->tableCells($thisuser[‘User’]);
}

?>

[/php]

I’d like to be able to pass “knownusers” into the next function-replace

Sponsor our Newsletter | Privacy Policy | Terms of Service