Download the PHP package elzobrito/olivia-pagination without Composer

On this page you can find all versions of the php package elzobrito/olivia-pagination. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package olivia-pagination

Olivia Pagination

Biblioteca simples de paginacao em PHP para calcular offset/limit e renderizar links de navegacao.

O projeto foi mantido com compatibilidade com a API original, entao o uso legado continua funcionando, com correcoes internas no calculo de paginas, na faixa "Mostrando X ao Y de Z" e na montagem das URLs.

Requisitos

Instalacao

Se estiver usando o projeto localmente:

Autoload

Namespace da classe:

Uso Basico

Exemplo com o fluxo compativel com a versao atual:

Metodos Principais

__construct($perPage, $instance, $customCSS = '')

Cria a paginacao.

Exemplo:

set_total($totalRows)

Define o total de registros da consulta.

get_start()

Retorna o offset calculado com base na pagina atual.

get_total_perPage()

Retorna a quantidade de itens por pagina.

get_limit()

Retorna uma string no formato usado com frequencia em LIMIT no MySQL.

get_limit_keys()

Retorna um array com offset e limit.

page_links($path = '?', $filter = null)

Renderiza o HTML da navegacao.

Exemplo simples:

Exemplo com filtros:

Resultado esperado nas URLs:

Exemplo Completo

Metodos Novos Opcionais

Esses metodos foram adicionados na refatoracao para facilitar integracao e testes, sem quebrar o uso anterior.

get_current_page()

Retorna a pagina atual.

get_total_pages()

Retorna o total de paginas calculado.

has_previous_page()

Indica se existe pagina anterior.

has_next_page()

Indica se existe proxima pagina.

set_current_page($page)

Permite definir a pagina manualmente, util para testes ou para integracao fora do fluxo padrao de $_GET.

to_array()

Retorna o estado consolidado da paginacao.

Exemplo de retorno:

Compatibilidade

O foco da refatoracao foi preservar a API publica existente.

Mantido:

Melhorado internamente:

Observacoes

Licenca

MIT


All versions of olivia-pagination with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1|^8.2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package elzobrito/olivia-pagination contains the following files

Loading the files please wait ...