Skip to content

Yii2 helper for inflect russians names (and words), using yandex API

Notifications You must be signed in to change notification settings

eugenyh/yii2-inflector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

yii2-inflector

Yii2 helper for inflect russian names (and words), using yandex API

Require CURL installed. Ubuntu (12.10 and up): sudo apt-get install curl libcurl3 libcurl4-openssl-dev php5-curl

Example:

...
use eugenyho\helpers\Inflector;
...
$fio = Yii::$app->user->identity->profile->name; //Get username Иванов Иван Иванович
$fio_a_dative = Inflector::Inflect($fio, 'dative'); // After inflect: Иванову Ивану Ивановичу
...

Installation:

php composer.phar require eugenyho/yii2-inflector "*"

Usage:

$NewWord = Inflector::Inflect($OldWord, $Case);

where $Case can be:

'nominative'        //именительный

'genitive'          //родительный

'dative'            //дательный

'accusative'        //винительный

'instrumentative'   //творительный

'prepositional'     //предложный

About

Yii2 helper for inflect russians names (and words), using yandex API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages