Git Product home page Git Product logo

pagi's Introduction

Pagi

Latest Stable Version Total Downloads Build Status

A better WordPress pagination utilizing Laravel's Pagination.

Requirements

Installation

Install via Composer:

$ composer require log1x/pagi

Usage

Basic Usage

use Log1x\Pagi\PagiFacade as Pagi;

$pagination = Pagi::build();

return $pagination->links();

Customization

To customize the view, simply publish it:

$ wp acorn vendor:publish --provider='Log1x\Pagi\PagiServiceProvider'

To use the newly generated view:

return $pagination->links('components.pagination');

For additional configuration, check out the Laravel Pagination documentation.

Bug Reports

If you discover a bug in Pagi, please open an issue.

Contributing

Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.

License

Pagi is provided under the MIT License.

pagi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pagi's Issues

Package not automatically discovered in Radicle

I've started using Radicle and was looking for a way to do pagination with blade templates and found your package. I installed it with composer, then when I tried to run wp acorn vendor:publish --provider='Log1x\Pagi\PagiServiceProvider' I got this:

 INFO  No publishable resources for tag [].

I then tried running wp acorn package:discover and noticed that pagi wasn't listed in the output:

   INFO  Discovering packages.  

  blade-ui-kit/blade-heroicons ................................................................................................................ DONE
  blade-ui-kit/blade-icons .................................................................................................................... DONE
  nesbot/carbon ............................................................................................................................... DONE
  nunomaduro/collision ........................................................................................................................ DONE
  nunomaduro/termwind ......................................................................................................................... DONE
  pestphp/pest ................................................................................................................................ DONE
  spatie/laravel-ignition ..................................................................................................................... DONE
  roots/bedrock ............................................................................................................................... DONE

By looking through the composer.json of some of these packages, I noticed that they have extra.laravel property defined. Looking at pagi's composer.json I see the property is extra.acorn instead. So I modified locally the composer.json to use laravel instead of acorn and auto-discovery and publishing works now ๐Ÿ™‚

I'm not sure if this is a problem with pagi, or maybe Radicle does something different compared to just Acorn or if it is a regression in how Acorn discovers packages. Actually digging up through Acorn a bit I found this commit from 3 years ago - roots/acorn@8053a45#diff-3d6f9f59a29536cc3cf940254daab52d5f7aaafb8af71a61140dd6eef34c7b81R5 - where PackageDiscoverCommand switched from using Roots\Acorn\PackageManifest(which supports both extra.laravel and extra.acorn) to using Illuminate\Foundation\PackageManifest(which doesn't support extra.acorn obviously ๐Ÿ™‚ ).

So do you think your package should switch over to using extra.laravel, or should Acorn consider adding back support for extra.acorn? I saw that you work at/are part of Roots, so I am guessing you'll have a good understanding of how to approach this ๐Ÿ™‚

Thank you for your time!

Does not work on term archives

This works great on the posts archive/home/blog.
However, when using Pagi on a term archive, it doesn't see any other pages to display.

Using {!! paginate_links() !!} works fine and as expected on here.

What information might be needed to help debug this?

Sage 10
Pagi 1.0.2

Thanks

Uncaught ReflectionException: Class "pagi" does not exist

Hi,

I'm getting Uncaught ReflectionException: Class "pagi" does not exist when adding this to my current Sage 10 project.

I'm looking through the code to try and debug it, looks like a problem with the service container? I wanted to find the issue and make a pull request if need be, but I can't seem to figure it out atm. ๐Ÿค”

PHP8/Acorn - Declaration of, Should be compatible with

I'm having issues installing this in a the latest sage theme. I'm getting this error:

Fatal error: Declaration of Illuminate\Foundation\Application::storagePath() must be compatible with Illuminate\Contracts\Foundation\Application::storagePath($path = '') in .../vendor/roots/acorn/src/Illuminate/Foundation/Application.php on line 458

v1.0.9 publicPath() fatal error

hey ๐Ÿ‘‹ @Log1x no rush on this, just a heads up that the latest release is throwing an error. It could def. be something on my side so will keep digging around early next week.

  • bedrock composer: "roots/acorn": "3.2.0"
  • theme composer: "log1x/pagi": "1.0.9" (1.0.8 works perfectly ๐Ÿ‘Œ)
Fatal error: Declaration of Illuminate\Foundation\Application::publicPath() 
must be compatible with Illuminate\Contracts\Foundation\Application::publicPath($path = '') 
in [site_root]/site/vendor/roots/acorn/src/Illuminate/Foundation/Application.php 
on line 453

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.