-
-
Save mcocciaTE/65a24e318af7b4339b26 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
public function my_cmp($a, $b){ | |
return strcmp($a["message"], $b["message"]); | |
} | |
/** | |
* Test 4: Fortunes | |
*/ | |
public function fortunesAction() | |
{ | |
$fortunes = Registry::get('em')->fortune->getAll(); | |
$fortunes[] = array( | |
'id' => count($fortunes) + 1, | |
'message' => 'Additional fortune added at request time.' | |
); | |
usort($fortunes, "my_cmp"); | |
$view = new View('table.phtml', array('fortunes' => $fortunes)); | |
$this->response->asHTML()->send($view); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment