Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $criteria = new CDbCriteria;
- $total = Recipe::model()->count();
- $pages = new CPagination($total);
- $pages->pageSize = 10;
- $pages->applyLimit($criteria);
- $posts = Recipe::model()->findAll($criteria);
- $this->render('index', array(
- 'posts' => $posts,
- 'pages' => $pages,
- ));
- <div id="posts">
- <?php foreach($posts as $rec): ?>
- <?php $rec_id=$rec['recipe_id']; $name=$rec['name']; ?>
- <?php echo $name=$rec['name']; ?>
- if(isset($_GET['Model_page'])){
- if($model->search()->pagination->pageCount < $_GET['Model_page']+1){
- throw new CHttpException(404,'No More results');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement