Yii v2 snippet guide III

Comparing #38 with #39

Revision #39 was created by rackycz rackycz on Feb 18, 2021, 10:18:01 AM.

Replace

Content

[...]
```
Now the language-switching links will produce URL like this: http://myweb.com/en/site/index . Without the rules the link would look like this: http://myweb.com/site/index?sys_lang=en . So the rule works in both directions. When URL is parsed and controllers are called, but also when a new URL is created using the URL helper.

**Search and replace**
---
Simple usage inI am using Notepad++ for mat Yii::t('text','text')ssive chan be searched using following regex for example in Notepad++. If you want to modify it massively, you can use the "replace" command, also in Notepad++.
 
 
**Yii::t()**
 
 
```
ges using Regex. If you press Ctrl+Shift+F you will be able to replace in all files.
 
 
**Yii::t()**
 
 
```
 
Yii::t('text'  ,  'text'   ) // NO
 
Yii::t('text','text') // YES
 

search: Yii::t\('([^']*)'[^']*'([^']*)'[^\)]*\)
replace with: Yii::t\('$1','$2'\)
```

**URLs (in Notepad++) **
[...]