Corrected as I see it :)

On Apr 17, 11:10 am, kryska <[email protected]> wrote:
> Hola a todos!
>
> Tengo una vista index.ctp con el código:
> <?php

echo $form->create( 'Cliente', array( 'action' =>
'borrarseleccionados' ) );

>     foreach ($clientes as $cliente):
>                  echo $cliente['Cliente']['id'];
>                  echo 
> $html->link('Editar',array('action'=>'editar','id'=>$cliente
> ['Cliente']['id']));
>                  echo $form->checkbox('Clientes.id.['.$cliente
> ['Cliente']['id'].']', array('value' => $cliente['Cliente']['id']));
>        endforeach;

echo $form->end('Borrar');

/*
>        echo $html->link('Borrar',array
> ('action'=>'borrarseleccionados'))
*/
> ?>
>
> De esta forma los checkboxes seran Messages.id.[1], Messages.id.[2],
> Messages.id.[3]…
>
> Y el clientes_controller:
>         function borrarseleccionados() {
>                 foreach($this->data['Clientes'] as $key => $value) {
>                         if($value != 0) {
>                         $this->Cliente->del($value);
>                         }
>                  }
>
>         }
> De esta forma recibo el error:Invalid argument supplied for foreach()
> Y si ponto function borrarseleccionados($value)  recibo el error:
> Missing argument 1 for ClientesController::borrarseleccionados()
>
> No se como pasarle los valores a la funcion....o lo que estoy haciendo
> mal.
>
> Agradecería muchisimo algo de ayuda....
> Saludos!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to