easyapprepo / yii-apputil
为 Yii 应用程序提供一些有用且必要的工具
dev-master
2020-01-31 09:21 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-29 03:47:16 UTC
README
为 Yii 应用程序提供一些有用且必要的工具,享受吧 :D
安装
- 导航到您 yii 1.x 应用的 /protected 文件夹,并需要此包
$ cd YiiAppPath/protected $ composer require easyapprepo/yii-apputil:"dev-master"
- 现在,在您的应用程序配置文件中(例如:protected/config/main.php)的 components 部分添加以下代码
'components'=>array( ... 'apputil' => array( 'class' => 'application.vendor.easyapprepo.yii-apputil.AppUtility', ),
- 然后,您可以像这样使用它
$persianNumber = Yii::app()->apputil->str->EN2PN('123456'); print $persianNumber; // ۱۲۳۴۵۶
方法
### 字符串方法
Yii::app()->apputil->str->EN2PN('123456'); //۱۲۳۴۵۶ Yii::app()->apputil->str->PN2EN('۱۲۳۴۵۶'); //123456 Yii::app()->apputil->str->fixPersianString('ولي'); //ولی