You can do it a number of ways. Basically, you just call the component's functions that you need from the controller and return values:
//In controller
$alteredData = $this->MyComponent->doSomethingWithData($data);
//In component
//You can also pass $data by reference if you want to alter it directly.
public function doSomethingWithData($data){
//alter data in some way
return $newData;
}
[Per the documentation][1], you also have direct access to the controller from the component so you can call controller methods from the component.
//In component
private $Controller;
public function initialize($controller){
$this->Controller = $controller;
}
public function doSomethingWithData($data){
//alter data in some way
$this->Controller->set('data', $data);
}
[1]:
[To see links please register here]