I have two models:

class Venta extends AppModel {
        var $name = 'Venta';
        var $hasMany = array (
                'Articulo' => array (
                        'className' => 'Articulo',
                        'conditions' => '',
                        'order' => '',
                        'dependent' => true,
                        'foreignKey' => 'articulo_id'
                )
        );
}

class Articulo extends AppModel {
        var $name = 'Articulo';
        var $belongsTo = array(
                'Venta' => array(
                        'className' => 'Venta',
                        'conditions' => '',
                        'order' => ''
                )
        );
}

when i do this in the controller:
$this->set('lineadeArticulos', $this->Venta->findAllById_unico($sid));

in the view i do this:
<?php foreach($lineadeArticulos as $lineadeArticulo): ?>
returns: Notice: Undefined index: descripcion in \app\views\ventas
\agregar_articulo.thtml on line 18
        $
Notice: Undefined index: precio in \app\views\ventas
\agregar_articulo.thtml on line 20

this returns in the view:
print_r($lineadeArticulos); -> Array ( [0] => Array ( [Venta] => Array
( [id] => 419 [cantidad] => [articulo_id] => 123 [id_unico] =>
45ca186d05d48 [modified] => 2007-02-07 11:20:33 [created] =>
2007-02-07 11:20:33 ) [Articulo] => Array ( ) ) )

the problem is foreach ? or wath


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to