Re: How code a edit view with a list

2008-01-02 Thread bibi

Or
[code]
foreach ($params['data']['Basketline'] as $Basketline) {
 echo $html-input(Backet/Basketline[$i]/quantite,
array('size'='4'));

[/code]

Doesn't work too ...

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



How code a edit view with a list

2008-01-01 Thread bibi

I have a basket with many lines. I want to display all the line in a
form. User can update the quantite of each line.
How can i code my view ?
I tryed
[code]
foreach ($params['data']['Basketline'] as $Basketline) {
   echo $html-input(Basketline/$i/quantite, array('size'='4'))
   $i++;
[/code]
without succes.

Here the $params['data'] :
[code]
Array
(
[Basket] = Array
(
[id] = 13
[total] = 100.00
[nb_article] = 1
[created] = 2008-01-01 19:07:59
[modified] = 2008-01-01 19:07:59
)

[Basketline] = Array
(
[0] = Array
(
[id] = 4
[montant] = 7.00
[quantite] = 1
   )

[1] = Array
(
[id] = 5
[montant] = 8.00
[quantite] = 2
  
[/code]

Here is the edit function of my controller
[code]
function edit($id=null) {
if (empty($this-params['data']))
{   $this-params['data'] = $this-Basket-read(null,$id);
...
[/code]

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