Show
Ignore:
Timestamp:
12/14/2007 03:27:07 PM (13 months ago)
Author:
Geert
Message:

Pagination library update:

  • Fixed bug that made it impossible to change uri_segment via initialize() without explicitely passing base_url again. (Also see: http://forum.kohanaphp.com/index.php/topic,389.0.html)
  • The generic url (used in the pagination style views) is now stored in $url. Shorter, keeps your views a bit cleaner and $base_url is reserved to be set by user.
  • Made $base_url, $directory, $style and $uri_segment private. They should not be available in pagination views.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/views/pagination/classic.php

    r1522 r1535  
    1010         
    1111        <?php if ($first_page): ?> 
    12                 <a href="<?php echo str_replace('{page}', 1, $base_url) ?>">&lsaquo;&nbsp;<?php echo Kohana::lang('pagination.first') ?></a> 
     12                <a href="<?php echo str_replace('{page}', 1, $url) ?>">&lsaquo;&nbsp;<?php echo Kohana::lang('pagination.first') ?></a> 
    1313        <?php endif; ?> 
    1414 
    1515        <?php if ($previous_page): ?> 
    16                 <a href="<?php echo str_replace('{page}', $previous_page, $base_url) ?>">&lt;</a> 
     16                <a href="<?php echo str_replace('{page}', $previous_page, $url) ?>">&lt;</a> 
    1717        <?php endif; ?> 
    1818         
     
    2323                        <strong><?php echo $i ?></strong> 
    2424                <?php else: ?> 
    25                         <a href="<?php echo str_replace('{page}', $i, $base_url) ?>"><?php echo $i ?></a> 
     25                        <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a> 
    2626                <?php endif; ?> 
    2727                 
     
    3030 
    3131        <?php if ($next_page): ?> 
    32                 <a href="<?php echo str_replace('{page}', $next_page, $base_url) ?>">&gt;</a> 
     32                <a href="<?php echo str_replace('{page}', $next_page, $url) ?>">&gt;</a> 
    3333        <?php endif; ?> 
    3434 
    3535        <?php if ($last_page): ?> 
    36                 <a href="<?php echo str_replace('{page}', $last_page, $base_url) ?>"><?php echo Kohana::lang('pagination.last') ?>&nbsp;&rsaquo;</a> 
     36                <a href="<?php echo str_replace('{page}', $last_page, $url) ?>"><?php echo Kohana::lang('pagination.last') ?>&nbsp;&rsaquo;</a> 
    3737        <?php endif; ?> 
    3838