1. <?php
2. class PostsController extends AppController {
3. ...
4. function index() {
5. $posts = $this->paginate();
6. if (isset($this->params['requested'])) {
7. return $posts;
8. } else {
9. $this->set(compact('posts'));
10. }
11. }
12. }
13. ?>
those codes are from 3.9.3 Elements part of the doc,some Q:
A) $posts = $this->paginate(); ---- posts is view or action?
paginate() is a method of PostsController?
B)$this->params['requested']---- mean?
C)return $posts---posts is the view?
D)$this->set(compact('posts'));----mean?
what kind of method compacts() is ?
posts is the view?
thx
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---