Revision #38 has been created by rackycz on Feb 18, 2021, 10:12:38 AM with the memo:
Replace
« previous (#37) next (#39) »
Changes
Title
unchanged
Yii v2 snippet guide III
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,yii2,beginer
Content
changed
[...]
**Search and replace**
---
Simple usage in format Yii::t('text','text') can 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()**
```
search: Yii::t\('([^']*)'[^']*'([^']*)'[^\)]*\)
replace with: Yii::t\('$1','$2'\)[...]
**URLs (in Notepad++) **
```
return $this->redirect('/controller/action')->send(); // NO
return $this->redirect(['controller/action'])->send(); // YES
search: ->redirect\(['][/]([^']*)[']\)
replace: ->redirect\(['$1']\)[...]