Link to home
Start Free TrialLog in
Avatar of radarhill
radarhill

asked on

CakePHP setFlash - Can it pass a variable to view?

Beneath is the code I'm using.  I'd like to offer the user the ability to restore the id of whatever it is they just deleted.  In order to do that I need to pass the id back to the view file:
	function admin_delete($id = null) {
		if ( !$id ) {
			$this->Session->setFlash('Invalid event', true);
			$this->redirect(array('action' => 'index'));
		}
		if ($this->Event->softDelete( $id )) {
			$this->Session->setFlash( 'Event deleted', true , array( 'restoreID' => $id ) );
			$this->redirect( array( 'action' => 'index' ) );
		}
	}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of radarhill
radarhill

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial