patriot7/yii-apputil

Some useful and necessary utilities for Yii applications

dev-master 2020-02-09 08:30 UTC

This package is not auto-updated.

Last update: 2024-04-15 04:11:26 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 patriot7/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('ولي'); //ولی