Ok, I have made couple of components working well, but this one give me
a error all the time, and I am unable to see what's wrong:
class StockRequestComponent extends Object
{
var $controller = true;
// I have to find a way to have a function here which can receive
parameters(or not)
// and would find only the locations for the current user
function startup (&$controller)
{
$this->controller = &$controller;
$Product = new Product;
$data = $Product->findAll();
$this->controller->set('StockRequest',$data);
}
}
The view is:
<div id="user_status">
<?php
if ($this->controller->name == 'Stocks')
{
echo '<form>';
echo '<select
OnChange="product.href=this.options[this.selectedIndex].value">';
echo '<option value="http://cake.bgsoftfactory.com/stocks/index/1/0">--
Select a Section --';
foreach ($StockRequest as $output):
echo '<option value="http://cake.bgsoftfactory.com/stocks/index/1/' .
$output['Product']['description'] . '">' .
$output['Product']['description'];
endforeach;
echo '</select>';
echo '</form>';
}
?>
</div>
the error is: " Undefined variable: StockRequest in.."....etc
A very similar component, on a different table, works just fine. Thanks
for your help,
Bernard
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---