PHPackages                             maxodrom/yii2-phpmorphy - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. maxodrom/yii2-phpmorphy

ActiveProject[Utility &amp; Helpers](/categories/utility)

maxodrom/yii2-phpmorphy
=======================

Yii2 PHPMorphy component

1.0.2(7y ago)13.6kMITPHP

Since Jun 7Pushed 7y agoCompare

[ Source](https://github.com/maxodrom/yii2-phpmorphy)[ Packagist](https://packagist.org/packages/maxodrom/yii2-phpmorphy)[ Docs](https://github.com/maxodrom/yii2-phpmorphy)[ RSS](/packages/maxodrom-yii2-phpmorphy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

YiiMorphy - Yii2 PHPMorphy component
====================================

[](#yiimorphy---yii2-phpmorphy-component)

Wrapper for package [maxakawizard/phpmorphy](https://github.com/MAXakaWIZARD/phpmorphy)and ported to Yii2 component base.

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

[](#installation)

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

Either run

```
php composer.phar require maxodrom/yii2-phpmorphy:~1.0

```

or add

```
"maxodrom/yii2-phpmorphy": "~1.0"

```

to the require section of your composer.json.

Usage
-----

[](#usage)

Define new component in your Yii2 application config (@app/config/web.php)

```
$config = [
    'id' => 'app-frontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'language' => 'ru-RU',
    'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm'   => '@vendor/npm-asset',
    ],
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => '',
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'user' => [
            'identityClass' => 'app\models\User',
            'enableAutoLogin' => true,
        ],
        'db' => $db,
        /**
         * Set component here!
         */
        'yiimorphy' => [
            'class' => 'maxodrom\phpmorphy\components\YiiMorphy',
            // 'language' => 'ru', // or 'uk', or 'de'
            // 'options' => [], // your options which will be passed to \phpMorphy's constructor
        ],
    ],
    'modules' => [],
    'params' => $params,
];
```

In your code you can use component via standard way:

```
/** @var \phpMorphy $morphy */
$morphy = Yii::$app->yiimorphy->morphy;

$word_one = 'КОТ';
$word_two = 'СОБАКА';

try {
	// word by word processing
	// each function return array with result or FALSE when no form(s) for given word found(or predicted)
	$base_form = $morphy->getBaseForm($word_one);
	$all_forms = $morphy->getAllForms($word_one);
	$pseudo_root = $morphy->getPseudoRoot($word_one);

	if(false === $base_form || false === $all_forms || false === $pseudo_root) {
		die("Can`t find or predict $word_one word");
	}

	echo 'base form = ' . implode(', ', $base_form) . "\n";
	echo 'all forms = ' . implode(', ', $all_forms) . "\n";

	echo "Testing bulk mode...\n";

	// bulk mode speed-ups processing up to 50-100%(mainly for getBaseForm method)
	// in bulk mode all function always return array
	$bulk_words = array($word_one, $word_two);
	$base_form = $morphy->getBaseForm($bulk_words);
	$all_forms = $morphy->getAllForms($bulk_words);
	$pseudo_root = $morphy->getPseudoRoot($bulk_words);

	// Bulk result format:
	// array(
	//   INPUT_WORD1 => array(OUTWORD1, OUTWORD2, ... etc)
	//   INPUT_WORD2 => FALSE getAllFormsWithGramInfo($word_one);

	exit;
} catch(\phpMorphy_Exception $e) {
	die('Error occured while text processing: ' . $e->getMessage());
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

3

Last Release

2897d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c79da7402e9376230130c590d274bfe4ffbe27e65c3584df4318bab3504371b?d=identicon)[mercium](/maintainers/mercium)

---

Tags

yii2seo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/maxodrom-yii2-phpmorphy/health.svg)

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

###  Alternatives

[umanskyi31/opengraph

Created a new component for Yii2. The Open Graph component for your website

119.7k](/packages/umanskyi31-opengraph)[daxslab/yii2-taggedview

Extension to help setup the standard HTML meta tags besides the ones defined by Opengraph and Twitter to contribute to website SEO

114.5k](/packages/daxslab-yii2-taggedview)[demi/seo

Library for working with SEO parameters of models

131.6k](/packages/demi-seo)[amirax/yii2-seo-tools

SEO tools for Yii 2 framework

131.1k](/packages/amirax-yii2-seo-tools)

PHPackages © 2026

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