Skip to content

расширение для Yii2 для scroll пагинации

License

Notifications You must be signed in to change notification settings

cybercog/yii2-scroll-pager-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Автоматическая Ajax пагинация при скролле страницы

описание

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist idsite/yii2-scroll-pager "*"

or add

"idsite/yii2-scroll-pager": "*"

to the require section of your composer.json file.

Usage

нужно вручную добавить условие на фильтрацию по ИДшникам, которые передаються по умолчанию в GET параметре "notid".

if ($ids = Yii::$app->getRequest()->getQueryParam('notid')) {
            $ids = array_map(function($v) {
                return (int) $v;
            }, explode(',', $ids));
            if ($ids) {
                return "AND city.id NOT IN (" . implode(',', $ids) . ")";
}
}

или если сортировка по айдишнику можно так

if ($ids = Yii::$app->getRequest()->getQueryParam('notid')) {
            if ($ids = explode(',', $ids)) {
                $query->andWhere('id<:lid',[':lid'=>array_pop($ids)]);
            }
        }

About

расширение для Yii2 для scroll пагинации

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages

  • JavaScript 71.5%
  • PHP 28.5%