[Solar-svn] Revision 3047

pmjones at solarphp.com pmjones at solarphp.com
Tue Mar 25 09:04:45 CDT 2008


Solar_Cli_MakeApp: [ADD] Add paging for the browse action and view.


Modified: trunk/Solar/Cli/MakeApp/Data/app-model.php
===================================================================
--- trunk/Solar/Cli/MakeApp/Data/app-model.php	2008-03-25 14:03:17 UTC (rev 3046)
+++ trunk/Solar/Cli/MakeApp/Data/app-model.php	2008-03-25 14:04:45 UTC (rev 3047)
@@ -14,7 +14,11 @@
         $model = Solar::factory(':model');
         
         // get the collection
-        $this->list = $model->fetchAll();
+        $this->list = $model->fetchAll(array(
+            'page'        => $this->_query('page', 1),
+            'paging'      => $this->_query('paging', 10),
+            'count_pages' => true,
+        ));
     }
     
     public function actionRead($id = null)

Modified: trunk/Solar/Cli/MakeApp/Data/view-browse.php
===================================================================
--- trunk/Solar/Cli/MakeApp/Data/view-browse.php	2008-03-25 14:03:17 UTC (rev 3046)
+++ trunk/Solar/Cli/MakeApp/Data/view-browse.php	2008-03-25 14:04:45 UTC (rev 3047)
@@ -1,5 +1,10 @@
 <h2><?php echo $this->getText('HEADING_BROWSE'); ?></h2>
 
+<?php
+    $pager = $this->pager($this->list->getPagerInfo());
+    echo $pager . "<br />";
+?>
+
 <ol>
 <?php foreach ($this->list as $item): ?>
     <li><ul>
@@ -20,4 +25,6 @@
 <?php endforeach; ?>
 </ol>
 
+<?php echo $pager . "<br />"; ?>
+
 <p><?php echo $this->action("{$this->controller}/add", 'ACTION_ADD'); ?>
\ No newline at end of file




More information about the Solar-svn mailing list