Created
January 15, 2010 12:16
-
-
Save henrikbjorn/278010 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class QuizzesController extends AppController | |
{ | |
var $helpers = array('Form'); | |
public function index() { | |
$this->set('description', 'Et xml/flash quiz værktøj'); | |
} | |
public function save($id = 1) { | |
//Has any form data been POSTed? | |
if(!empty($this->data)) { | |
//If the form data can be validated and saved... | |
if($this->Quiz->save($this->data)) { | |
//Set a session flash message and redirect. | |
$this->Session->setFlash("Quiz Saved!"); | |
$this->redirect('/quizzes'); | |
} | |
} | |
//If no form data, find the recipe to be edited | |
//and hand it to the view. | |
$this->set('quiz', $this->Quiz->findById($id)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment