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 Yii::t()**
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++.
replace with: Yii::t\('$1','$2'\)
**Running Yii project in Vagrant. (Simplified version)**
- Do you want your colleague-developers to use identical environment like you have?
- Or do you want to easily setup whole server after you reinstalled your computer?
This is when Vagrant is helpful.
Vagrant creates a virtual machine with a web server (using almost any OS/PHP/SQL you specify), while the docroot is on your local disk so you can easily modify the PHP files in your IDE and in your OS. Vagrant works just like composer or NPM. It is a library of available OS images and you just pick one. Whole configuration is defined in one text-file, named Vagrantfile, and all you need is just a few commands to run it. And debugging is no problem.
List of all available OS images is here:
Both Yii demo-applications already contain the Vagrantfile, but its setup is unclear to me - it is too PRO. So I want to publish my simplified version which uses OS image named [scotch/box](https://box.scotch.io). (It has some advantages, the disadvantage is older PHP in the free version)
The Vagrantfile is stored in the root-folder of your demo-project. My Vagrantfile contains following commands.