I believe you meant...
function delete($id = null)
{
$this->setAction('manage_employees', $id);
}
function manage_employees($deleted_employee)
{
}
Which is an error present in the original code as well.
Mariano Iglesias wrote:
>
>
> Of course:
>
> function delete($id = null)
> {
> $this->setAction('manage_employees', $deleted_employee);
> }
>
> function manage_employees($deleted_employee)
> {
> }
>
> You don't need to use func_get_args
>
> -MI
>
> ---------------------------------------------------------------------------
>
> Remember, smart coders answer ten questions for every question they ask.
> So be smart, be cool, and share your knowledge.
>
> BAKE ON!
>
> blog: http://www.MarianoIglesias.com.ar
>
>
> -----Mensaje original-----
> De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
> de [EMAIL PROTECTED]
> Enviado el: Jueves, 19 de Abril de 2007 03:20 p.m.
> Para: Cake PHP
> Asunto: setAction - reading the parameters
>
>
> Hi all,
>
> When using setAction to redirect to another controller action, the
> parameters are passed such that they can be retrieved via
> <code>func_get_args()</code>.
>
> Looks like this:
>
> <code>
> // the delete action should be redirected to the manage action
> function delete($id = null)
> {
> $this->setAction('manage_employees', $deleted_employee);
> //$this->redirect('employees/manage_employees');
> }
>
> // the parameter is read via func_get_args()
> function manage_employees()
> {
> $args = func_get_args();
> $delete_employee = $args[0];
> }
> </code>
>
> Is there a better way to access the passed parameter in the action
> manage_employees above - other than $args[0]?
>
> Thanks,
> Quang
>
>
>
> __________ Informaci�n de NOD32, revisi�n 2205 (20070419) __________
>
> Este mensaje ha sido analizado con NOD32 antivirus system
> http://www.nod32.com
>
>
>
> >
>
>
--
View this message in context:
http://www.nabble.com/setAction---reading-the-parameters-tf3608966.html#a10153789
Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---