{"id":20160362,"url":"https://github.com/kriptograf/yii2-infinite-scroll","last_synced_at":"2025-07-21T03:03:00.100Z","repository":{"id":82223192,"uuid":"138421015","full_name":"kriptograf/yii2-infinite-scroll","owner":"kriptograf","description":"Yii2 extension for infinite-scroll jQuery plugin","archived":false,"fork":false,"pushed_at":"2018-06-23T17:37:18.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T02:41:25.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kriptograf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-23T17:30:07.000Z","updated_at":"2018-06-23T17:37:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"e405dde8-413a-488a-8855-8b5208ca7c52","html_url":"https://github.com/kriptograf/yii2-infinite-scroll","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kriptograf/yii2-infinite-scroll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-infinite-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-infinite-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-infinite-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-infinite-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kriptograf","download_url":"https://codeload.github.com/kriptograf/yii2-infinite-scroll/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-infinite-scroll/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266231762,"owners_count":23896473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T00:13:47.010Z","updated_at":"2025-07-21T03:03:00.084Z","avatar_url":"https://github.com/kriptograf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"yii2-infinite-scroll\n================\n\nYii2 extension for infinite-scroll jQuery plugin, providing scrolling functionality for widgets such as `ListView`.\nIt renders a hyperlink that leads to subsequent page of a target and registers \ninfinite-scroll jQuery plugin which uses javascript to fetch and append content for subsequent pages,\ngracefully degrading to complete page reload when javascript is disabled.\n\nSeveral behaviours allowing to customize scroll behavior are provided out of the box,\nincluding twitter-style manual trigger, local scroll in overflow div, masonry integration and others.\n\nAt the moment this extention only supports v2.x of infinite-scroll plugin.\n\n## Resources\n * Infinite-Scroll jQuery plugin [documentation](https://github.com/paulirish/infinite-scroll)\n\n## Installation\n\n### Composer\n\nAdd extension to your `composer.json` and update your dependencies as usual, e.g. by running `composer update`\n```js\n{\n    \"require\": {\n        \"kriptograf/yii2-infinite-scroll\": \"1.0.*@dev\"\n    }\n}\n```\n\n## Widget Configuration\n\nIn addition to most of the properties that `LinkPager` provides, this widget also allows you to configure:\n \n * $widgetId *string* owner widget id, required\n * $itemsCssClass *string* CSS class of a tag that encapsulates items, required\n * $pluginOptions *array* infinite-scroll jQuery plugin options. For more information refer to infinite-scroll [documentation](https://github.com/paulirish/infinite-scroll)\n * $contentLoadedCallback *string|JsExpression* javascript callback to be executed on loading the content via ajax call\n  \n## Sample Usage\n\nPlugin works by appending fetched items to the end of parent container, so it is required\nto configure `layout` property of parent `ListView` widget, wrapping `{items}` into e.g. `div` container with some class (to be used as a selector).\nIt is possible to configure all selectors that widget initializes plugin with to fit your project requirements, but it general it is enough to\nset `itemCssClass` (class of that wrapping tag that we created) and `widgetId` (which would ensure multiple plugins on the same page would not conflict).\n\nSo the minimal required configuration would look like this:\n```php\necho ListView::widget([\n    ...\n    'id' =\u003e 'my-listview-id',\n    'layout' =\u003e \"{summary}\\n\u003cdiv class=\\\"items\\\"\u003e{items}\u003c/div\u003e\\n{pager}\",\n    'pager' =\u003e [\n        'class' =\u003e InfiniteScrollPager::className(),\n        'widgetId' =\u003e 'my-listview-id',\n        'itemsCssClass' =\u003e 'items',\n    ],\n]);\n```\n\nAn example illustrating how to customize some widget / plugin options: \n```php\necho ListView::widget([\n    ...\n    'id' =\u003e 'my-listview-id',\n    'layout' =\u003e \"{summary}\\n\u003cdiv class=\\\"items\\\"\u003e{items}\u003c/div\u003e\\n{pager}\",\n    'pager' =\u003e [\n        'class' =\u003e InfiniteScrollPager::className(),\n        'widgetId' =\u003e 'my-listview-id',\n        'itemsCssClass' =\u003e 'items',\n        'contentLoadedCallback' =\u003e 'afterAjaxListViewUpdate',\n        'nextPageLabel' =\u003e 'Load more items',\n        'linkOptions' =\u003e [\n            'class' =\u003e 'btn btn-lg btn-block',\n        ],\n        'pluginOptions' =\u003e [\n            'loading' =\u003e [\n                'msgText' =\u003e \"\u003cem\u003eLoading next set of items...\u003c/em\u003e\",\n                'finishedMsg' =\u003e \"\u003cem\u003eNo more items to load\u003c/em\u003e\",\n            ],\n            'behavior' =\u003e InfiniteScrollPager::BEHAVIOR_TWITTER,\n        ],\n    ],\n]);\n```\n\n## License\n\nExtension is released under MIT license, same as underlying jQuery plugin.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriptograf%2Fyii2-infinite-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkriptograf%2Fyii2-infinite-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriptograf%2Fyii2-infinite-scroll/lists"}