Is there a way to access the Model, to make Database calls inside of a
component?
class CostsController extends AppController
{
var $name = 'Costs';
var $components=array("Findcost");
function index()
{
//Do i send a reference to model this way?
$this->Component->calculate( ???);
}
}
class FindcostComponent
{
var $model;
var $myarray = array();
//Or is there a way to retrieve the model reference here
//like you do
// with the startup function
//to access the controller?
function calculate( ??? )
{
//do some calculations
$this->myarray[$itemcost]=100;
//I want to save to table here
$this->model->save($this->myarr);
}
Thanks for your help,
Bill
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---