PHPackages                             maybeworks/yii2-libs - 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. [Framework](/categories/framework)
4. /
5. maybeworks/yii2-libs

AbandonedArchivedYii2-extension[Framework](/categories/framework)

maybeworks/yii2-libs
====================

Library for Yii PHP framework 2.0

0362PHP

Since Sep 19Pushed 9y ago3 watchersCompare

[ Source](https://github.com/bartlab-archive/yii2-libs)[ Packagist](https://packagist.org/packages/maybeworks/yii2-libs)[ RSS](/packages/maybeworks-yii2-libs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-libs
=========

[](#yii2-libs)

Library for Yii PHP framework 2.0

Features:
---------

[](#features)

- Traits for ActiveRecord that add new functionality

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require "maybeworks/yii2-libs" "*"

```

or add

```
"maybeworks/yii2-libs" : "*"
```

to the require section of your application's `composer.json` file.

Usage
-----

[](#usage)

SearchTrait usage
-----------------

[](#searchtrait-usage)

```
use maybeworks\libs\SearchTrait;

class User extends ActiveRecord implements IdentityInterface {
    use SearchTrait;

    // [optional] default page size
    public $pageSize = 20;

    // ... other code ...

    public function init(){
        // add validators
        $this->searchInit();
    }

    // filter by LIKE %..%
    public function filterLikeAttributes() {
        return [
     	    'id',
     		'username',
     		'email',
     		'first_name',
     		'last_name',
     		'comment',
     	];
    }

    // filter by column = "value"
    public function filterAttributes() {
        return [
     	    'id',
     		'status',
     		'created_at',
     		'updated_at',
     		'last_visit',
     	];
    }
}

```

```
$list = User::forSearch(['email'=>'gmail.com']);

/*
* or by form post
*
* $item = new User();
* $item->load(Yii::$app->request->post());
* $list = $item->search();
*
* or by direct value set
* $item = new User();
* $item->email = 'gmail.com';
* $list = $item->search();
*/

foreach ($list->getModels() as $user){
    echo $user->email;
}

```

AdditionsTrait usage
--------------------

[](#additionstrait-usage)

```
use maybeworks\libs\AdditionsTrait;

// get new record
$user = User::getItem();

// get record by ID
$user = User::getItem(10);

// get record copy
$user = User::getItem(10);
$new = $user->copy;

?>

```

> [![MaybeWorks](https://camo.githubusercontent.com/9f9031b17497548afc73171c238edb4ed7cd36afd203a0d3bbac1df3975ce5fd/687474703a2f2f6d617962652e776f726b732f6c6f676f2f6c6f676f5f6d772e706e67)](http://maybe.works)
> *Nothing is impossible, limit exists only in the minds of...*
> [maybe.works](http://maybe.works)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.5% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6072eea5615b5a1c1a32462b0ab0132d4dae4e897f13bb7ac5cb67bff27c9579?d=identicon)[B@RT](/maintainers/B@RT)

---

Top Contributors

[![BARTlab](https://avatars.githubusercontent.com/u/889330?v=4)](https://github.com/BARTlab "BARTlab (29 commits)")[![DimaKoval](https://avatars.githubusercontent.com/u/7812212?v=4)](https://github.com/DimaKoval "DimaKoval (2 commits)")

### Embed Badge

![Health badge](/badges/maybeworks-yii2-libs/health.svg)

```
[![Health](https://phpackages.com/badges/maybeworks-yii2-libs/health.svg)](https://phpackages.com/packages/maybeworks-yii2-libs)
```

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

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