PHP code example of kharanenka / oc-pagination

1. Go to this page and download the library: Download kharanenka/oc-pagination library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kharanenka / oc-pagination example snippets



"kharanenka/oc-pagination": "1.0.*"



public function defineProperties()
{
    $arProperties = [
        //Component property array
    ];
    
    $arProperties = array_merge($arProperties, Pagination::getProperties('plugin_name'));
    return $arProperties;
}


//$arSettings = $this->properties
$arPagination = Pagination::get($iCurrentPage, $iTotalCount, $arSettings);
 


[
    [
        'name' => 'First',
        'value' => 1,
        'class' => 'pagination-first-button',
        'code' => 'first',
    ],
    ...
    [
        'name' => '3',
        'value' => 3,
        'class' => 'pagination-i _act',
        'code' => null,
    ],
    ...
    [
        'name' => 'Last',
        'value' => 10,
        'class' => 'pagination-last-button',
        'code' => 'last',
    ]
]