If your controller is using the model you want to use for saving, then
store the controller on startup of your component.
Afterward you can use the controller reference to save the data.
Something like this in you component :
function startup(&$controller)
{
$this->controller = $controller;
}
function saveData($data)
{
$this->controller->model->save($data);
}
hth
On Feb 25, 2:27 am, bob <[EMAIL PROTECTED]> wrote:
> how do i save to a database in a component in cakephp 1.2?
>
> for example: in my component, i have var $uses = array('MyModel');
> then I do $this->MyModel->save(.....)...
>
> how do i do this?
>
> thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---