Difference between #38 and #39 of
Yii v2 snippet guide III

Revision #39 has been created by rackycz on Feb 18, 2021, 10:18:01 AM with the memo:

Replace
« previous (#38) next (#40) »

Changes

Title unchanged

Yii v2 snippet guide III

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,yii2,beginer

Content changed

[...]
```
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++) **
[...]
8 0
4 followers
Viewed: 165 005 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Jan 21, 2021
Last updated: 9 months ago
Update Article

Revisions

View all history