From 2389d66da849798f8d4ec5f10e3b07c11da49185 Mon Sep 17 00:00:00 2001 From: Michael Francis Date: Sat, 28 May 2011 13:28:16 -0400 Subject: Initial Commit --- controllers/ProfilesController.php | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 controllers/ProfilesController.php (limited to 'controllers/ProfilesController.php') diff --git a/controllers/ProfilesController.php b/controllers/ProfilesController.php new file mode 100644 index 0000000..022b540 --- /dev/null +++ b/controllers/ProfilesController.php @@ -0,0 +1,41 @@ +request->id); + return compact('profile'); + } + + public function add() { + $profile = Profile::create(); + + if (($this->request->data) && $profile->save($this->request->data)) { + $this->redirect(array('Profiles::view', 'args' => array($profile->id))); + } + return compact('profile'); + } + + public function edit() { + $profile = Profile::find($this->request->id); + + if (!$profile) { + $this->redirect('Profiles::index'); + } + if (($this->request->data) && $profile->save($this->request->data)) { + $this->redirect(array('Profiles::view', 'args' => array($profile->id))); + } + return compact('profile'); + } +} + +?> \ No newline at end of file -- cgit v1.2.3