easyapprepo/yii-apputil

Some useful and necessary utilities for Yii applications

dev-master 2020-01-31 09:21 UTC

This package is not auto-updated.

Last update: 2025-06-08 07:13:11 UTC


README

Some useful and necessary utilities for Yii applications Enjoy :D

Installation

  • Navigate to /protected folder of you yii 1.x application and require the package
    $ cd YiiAppPath/protected
    $ composer require easyapprepo/yii-apputil:"dev-master"
  • Now, on your application configuration (eg: protected/config/main.php) add the following code to the components section
'components'=>array(
...
        'apputil' => array(
            'class' => 'application.vendor.easyapprepo.yii-apputil.AppUtility',
        ),
  • then, you can use it like this
$persianNumber = Yii::app()->apputil->str->EN2PN('123456');
print $persianNumber; // ۱۲۳۴۵۶

Methodes

###String Methodes

Yii::app()->apputil->str->EN2PN('123456'); 
//۱۲۳۴۵۶

Yii::app()->apputil->str->PN2EN('۱۲۳۴۵۶'); 
//123456

Yii::app()->apputil->str->fixPersianString('ولي'); 
//ولی