PHPackages                             happyendik/yii2-parser-dataprovider - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. happyendik/yii2-parser-dataprovider

ActiveYii2-extension[Parsing &amp; Serialization](/categories/parsing)

happyendik/yii2-parser-dataprovider
===================================

0.1.1(8y ago)08MITPHP

Since Jan 30Pushed 8y agoCompare

[ Source](https://github.com/happyendik/yii2-parser-dataprovider)[ Packagist](https://packagist.org/packages/happyendik/yii2-parser-dataprovider)[ RSS](/packages/happyendik-yii2-parser-dataprovider/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (3)Used By (0)

Установка
---------

[](#установка)

- Установка пакета с помощью Composer.

```
composer require happyendik/yii2-parser-dataprovider

```

Использование
-------------

[](#использование)

- Создайте свой класс DataProvider, унаследуйте его от абстрактного класса `happyendik\ParserDataProvider`и реализуйте абстрактные методы данного класса:

```
    /**
     * @return integer
     */
    protected function getItemsOnPage()
    {
        //Определение количества моделей на странице
    }

```

```
    /**
     * @return integer
     */
    protected function getPagesAmount()
    {
        //определение количества страниц
    }

```

```
    /**
     * @return integer
     */
    protected function getItemsAmount()
    {
        //определение количества моделей (например, новостей или статей)
    }

```

```
    /**
     * @param integer $i
     * @return happyendik\ItemInterface[]
     */
    protected function getItemsForPage($i)
    {
        //Получение моделей для страницы
        //Метод должен возвращать массив объектов, реализующих happyendik/ItemInterface
            $items[] = new Item([
                'attribute1' => $item->attribute1,
                'attribut2' => $item->attribute2,
                .....
                'attributeN' => $item->attributeN
            ]);
        }

        return $items;
    }
}

```

- Создайте класс для модели, реализующий `happyendik\ItemInterface`, и перечислите все аттрибуты модели:

```
class Item extends Object implements happyendik\ItemInterface
{
    /**
     * @var string
     */
    public $title;

    /**
     * @var string
     */
    public $link;

    /**
     * @return array
     */
    public function getAttributes()
    {
        return [
            'title' => $this->title,
            'link' => $this->link
        ];
    }

    /**
     * @inheritdoc
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * @inheritdoc
     */
    public function getLink()
    {
        return $this->link;
    }
}

```

- Подключайте свой `CustomDataProvider`, как дефолтные датапровайдеры в Yii2

```
    public function actionIndex()
    {
        $dataProvider = new CustomDataProvider([
            'pagination' => [
                'pageSize' => 20
            ]
        ]);

        return $this->render('index', [
            'dataProvider' => $dataProvider
        ]);
    }

```

- И используйте стандартные приемы работы с датапровайдерами

```
echo \yii\widgets\ListView::widget([
    'dataProvider' => $dataProvider,
    'itemView' => function ($model) {
        return '' . $model['title'] . '';
    }
]);

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3025d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/727036707a274adc63abc1077ea780606b31759ef1ec24b916d243155fc199cd?d=identicon)[evgn](/maintainers/evgn)

---

Top Contributors

[![happyendik](https://avatars.githubusercontent.com/u/25950192?v=4)](https://github.com/happyendik "happyendik (6 commits)")

---

Tags

parseryii2

### Embed Badge

![Health badge](/badges/happyendik-yii2-parser-dataprovider/health.svg)

```
[![Health](https://phpackages.com/badges/happyendik-yii2-parser-dataprovider/health.svg)](https://phpackages.com/packages/happyendik-yii2-parser-dataprovider)
```

###  Alternatives

[nizsheanez/yii2-json-rpc

A lightweight JsonRpc Server and Client for PHP

2034.0k](/packages/nizsheanez-yii2-json-rpc)[devgroup/yii2-jsoneditor

Yii2 jsoneditor widget

1199.6k1](/packages/devgroup-yii2-jsoneditor)[demi/sitemap-generator

Yii2 component for generate sitemap.xml files.

1427.0k](/packages/demi-sitemap-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
