TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Pagination module
  • It seems that quite a few people use Shadowhand's pagination module! :-) But many seem to be making similar modifications (e.g. composer support).

    Seems a shame to duplicate effort, that's all.... :) Perhaps if this was once again an 'official' module, we could all send pull requests to that?

    Thanks!

  • https://github.com/kohana/pagination this module already in 'official' repository, but have problems with url's generate ( incorrect use Request).

  • (Defunct) pagination module for Kohana, see shadowhand/pagination

  • Yeah, @cs278 is correct: the official one's marked 'defunct', so I avoid using it.

    Is there anyone around who would be interested in evaluating and approving pull requests to it?

    This is the version that I'm currently using: https://github.com/kohana-qs/pagination

  • @samwilson https://github.com/kohana-qs/pagination/blob/3.3/master/classes/Kohana/Pagination.php#L203 HMVC not supported and why used Request::current() , rather than Request::initial()?.
    Bug with multi parameters, ex: route have params lang and page but paginator send in Route::uri() only page, lang sets as default. Fix:

    $request = Request::current();
    
    $params = array_merge(
        $request->param(),
        array($this->config['current_page']['key'] => $page)
    );
    
    $uri = $request->route()->uri($params);
    
    return URL::site($uri).URL::query();
    

    Why introduce method Pagination::render()? Immediately, we can pass values ​​to the current pagination View and inside it "run"Pagination class. Incidentally View variables of modules must have more complex names to avoid accidentally overwriting user values​​. Ex: views/pagination/basic replace $first_page by $pagination_first_page or $kohana_first_page and so on ...

  • @WinterSilence, sure, all good points, but really I was just getting at the fact that at least there is active development going on in that fork, whereas the offical module has been left to moulder. :-( Also that development is proceeding (at varying rates) on a dozen different forks....

  • I dont see development, only cosmetic changes. Saw another module that supports ORM, caching and other pleasant trifles, post link if remember url

  • Is there a pagination module that supports SORTING (a parameter you can pass into it) ... none of these look like it does it. With sorting, you may have to reset the counter (move to start of the list so reset the current_page, etc.

  • @chrisgo After sorting, you need to go to the first page:

    < a href=".../?sort=name&order=ask&page=1" >sort by name< /a >
    

    So you can use any module, but they all have the problem described above me.

    My fork

    Generally, additional modules in "full ass" - almost no qualitative. sad but true

  • have you taken a look at https://github.com/morgan/kohana-paginate that's a nice pagination module IMHO

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion