Return to Snippet

Revision: 17984
at September 18, 2009 15:32 by sveggiani


Initial Code
// guardamos en el controlador del edit el referer
$this->set('returnTo', $this->referer());

// si en el form necesitamos poner links para cancelar hacemos...
link(__('Return to Admin Index', true), $returnTo);?>

// en el formulario incluimos un campo oculto para recuperar luego el valor
input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo)); ?>

// y luego de procesar el formulario redireccionamos
if (isset($this->data['App']['returnTo'])) {
    $this->redirect($this->data['App']['returnTo']);
}

Initial URL
http://cakephpilia.blogspot.com/2009/08/volver-la-pagina-correcta-y-la.html

Initial Description


Initial Title
save the return page of a form with search criteria & url parameters

Initial Tags
cakephp

Initial Language
PHP