fix warning
authorChristian Weiske <cweiske@cweiske.de>
Sat, 5 May 2012 19:58:45 +0000 (21:58 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Sat, 5 May 2012 19:58:45 +0000 (21:58 +0200)
src/phorkie/Html/Pager.php

index f5c8105..57794a1 100644 (file)
@@ -10,6 +10,10 @@ class Html_Pager
      */
     public function __construct($itemCount, $perPage, $currentPage, $filename)
     {
      */
     public function __construct($itemCount, $perPage, $currentPage, $filename)
     {
+        $append = true;
+        if (strpos($filename, '%d') !== false) {
+            $append = false;
+        }
         //fix non-static factory method error
         error_reporting(error_reporting() & ~E_STRICT);
         $this->pager = \Pager::factory(
         //fix non-static factory method error
         error_reporting(error_reporting() & ~E_STRICT);
         $this->pager = \Pager::factory(
@@ -20,7 +24,7 @@ class Html_Pager
                 'totalItems'  => $itemCount,
                 'currentPage' => $currentPage,
                 'urlVar'      => 'page',
                 'totalItems'  => $itemCount,
                 'currentPage' => $currentPage,
                 'urlVar'      => 'page',
-                'append'      => false,
+                'append'      => $append,
                 'path'        => '/',
                 'fileName'    => $filename,
                 'separator'   => '###',
                 'path'        => '/',
                 'fileName'    => $filename,
                 'separator'   => '###',