perhaps your cost calculation should be in the products model.
it's not taboo to put custom methods into the model, as long as it is
very closely related to the model data.

if you absolutely have to call it from the controller then give your
component a controller param, and in the calling controller do this
$this->Findcost->controller = $this;
then you have a reference back to the controller from in the component
then when you call the method from the controller
$this->Findcost->calculate

your component can access the model
$this->controller->MyModel->findAll()

it can be done, and that's how you do it.
but for the circumstance you give an example too, this is definitely
the wrong way to do it
it should either be controller method, which in this case seems best,
or in other circumstances a model method


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to