Created
July 4, 2010 02:56
-
-
Save jpablobr/463057 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class PostsController extends AppController { | |
| var $name = 'Posts'; | |
| function random() { | |
| $random = $this->Post->find('first',array( | |
| 'conditions' => array( | |
| 'Post.active'=>1, | |
| ), | |
| 'order' => 'rand()', | |
| )); | |
| $this->view($random['Post']['id']); | |
| $this->render('view'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment