-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.php
More file actions
57 lines (47 loc) · 1.45 KB
/
Copy pathModule.php
File metadata and controls
57 lines (47 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Created by PhpStorm.
* User: user
* Date: 30.07.2017
* Time: 13:41
*/
namespace wscvua\ws_admin_simple;
use Yii;
class Module extends \yii\base\Module
{
public $controllerNamespace = 'wscvua\ws_admin_simple\controllers';
public function init()
{
parent::init();
$this->registerTranslations();
}
public function registerTranslations()
{
Yii::$app->i18n->translations['wscvua/ws_admin_simple/*'] = [
'class' => 'yii\i18n\PhpMessageSource',
'sourceLanguage' => 'en-US',
'basePath' => '@vendor/ws-cv-ua/ws-admin-simple/messages',
'fileMap' => [
'wscvua/ws_admin_simple/app' => 'app.php',
],
];
}
public static function t($category, $message, $params = [], $language = null)
{
return Yii::t('wscvua/ws_admin_simple/' . $category, $message, $params, $language);
}
public static function pre($arr)
{
echo '<pre>'.print_r($arr,1),'</pre>';
}
public static function outCode($code){
return '<pre><code class="php">'.trim(htmlspecialchars($code)).'</code></pre>';
}
public static function clearPhone($phone){
$clear_phone = str_replace('(','', $phone);
$clear_phone = str_replace(')','', $clear_phone );
$clear_phone = str_replace(' ','', $clear_phone );
$clear_phone = str_replace('-','', $clear_phone );
return $clear_phone;
}
}