Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Paginate Plugin for dwoo2 #9

Open
MikeW22 opened this issue Jan 31, 2014 · 5 comments
Open

Paginate Plugin for dwoo2 #9

MikeW22 opened this issue Jan 31, 2014 · 5 comments
Assignees

Comments

@MikeW22
Copy link

MikeW22 commented Jan 31, 2014

I use dwoo for many projects. Now, I'm lookin for a paginate Plugin.

@emulienfou
Copy link
Contributor

Is it what you want ? http://www.phpinsider.com/php/code/SmartyPaginate/

@MikeW22
Copy link
Author

MikeW22 commented Feb 3, 2014

Right !

Best Regards

Michael Woldrich

Von: DSanchez [mailto:[email protected]]
Gesendet: Montag, 3. Februar 2014 07:51
An: emulienfou/dwoo
Cc: MikeW22
Betreff: Re: [dwoo] Paginate Plugin for dwoo2 (#9)

Is it what you want ? http://www.phpinsider.com/php/code/SmartyPaginate/


Reply to this email directly or view it on GitHub #9 (comment) . https://github.com/notifications/beacon/6555811__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNjk0MzA0NSwiZGF0YSI6eyJpZCI6MjQ2OTY3MDB9fQ==--dec6c89403f864a5a9a9ff4f308ffc8637b38cd6.gif

@emulienfou emulienfou self-assigned this Feb 8, 2014
@emulienfou emulienfou added this to the 2.0 milestone Feb 8, 2014
@themightychris
Copy link
Contributor

Maybe this template I use would be helpful to you:

{template pagingLinks total pageSize=12 showAll=false}
<div class="paging">
    {if $total > $pageSize}
        {$previousOffset = tif($.get.offset && $.get.offset > $pageSize ? $.get.offset - $pageSize : 0)}
        {$nextOffset = tif($.get.offset ? $.get.offset + $pageSize : $pageSize)}
        {if $.get.offset > 0}
            <a class="paging-link prev" href="?{refill_query limit=$pageSize offset=$previousOffset}">&larr;&nbsp;Prev</a>
        {/if}

        <ol class="paging-pages">
        {foreach item=page from=range(1,ceil($total/$pageSize))}
            {math "($page-1)*$pageSize" assign=offset}
            <li class="paging-page">
                {if $.get.offset == $offset}
                    <strong class="paging-current">{$page}</strong>
                {else}
                    <a class="paging-link" href="?{refill_query limit=$pageSize offset=$offset}">{$page}</a>
                {/if}
            </li>
        {/foreach}
        </ol>

        {if $.get.offset < $total - $pageSize}
            <a class="paging-link next" href="?{refill_query limit=$pageSize offset=$nextOffset}">Next&nbsp;&rarr;</a>
        {/if}

        {if $showAll}
            <a class="paging-link show-all" href="?{refill_query limit=0}">Show All ({$total|number_format})</a>
        {/if}
    {/if}
</div>
{/template}

@emulienfou
Copy link
Contributor

For information, the Block template as been replaced by function in Dwoo 2.

So, in Dwoo 2.x branch you need to replace {template}{/template} by {function}{/function}.

@emulienfou
Copy link
Contributor

Need to check this code in 1.2.2 and provide a demo for future use!

@emulienfou emulienfou modified the milestones: 1.2.3, 2.0 Sep 10, 2016
@emulienfou emulienfou modified the milestones: 1.2.3, 1.3.0 Sep 19, 2016
@emulienfou emulienfou modified the milestone: 1.3.1 Dec 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants