1. Go to this page and download the library: Download sergmoro1/yii2-ru-kit library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sergmoro1 / yii2-ru-kit example snippets
use sergmoro1\rukit\FullDate;
use sergmoro1\rukit\Translit;
class Post extends ActiveRecord
{
...
public function behaviors() {
return [
['class' => FullDate::className()],
['class' => Translit::className()],
];
}
...
// Translit
public function beforeSave($insert)
{
if(parent::beforeSave($insert))
{
$this->translit();
return true;
} else
return false;
}