using yii command extract message which need i18n

using yii command extract message which need i18n
first you should create a config file for yii command:

.\yii message/config-template path/to/config.php`

such as messages/config.php
made some modify to satisfy you needs
then run yii command to extract message from you php file or html file:

.\yii message messages\config.php

then translate you message to you needed language under messages/language-ID
dir

Yii2 alias

Alias
You can find below default alias in yii2\BaseYii.php’s $alias:

$aliases variable's init:
@yii D:\xampp\htdocs\basic\vendor\yiisoft\yii2
basic\vendor\yiisoft\extensions.php file add extension path to @yii
yii2\web\Application.php's preInit method, create below alias:
setBasePath method:
@app means your Yii2's root directory, D:\xampp\htdocs\basic
setVendorPath method:
@vendor D:\xampp\htdocs\basic\vendor
@bower D:\xampp\htdocs\basic\vendor\bower
@npm D:\xampp\htdocs\basic\vendor\npm
setRuntimePath method:
@runtime D:\xampp\htdocs\basic\runtime

yii2\web\Application.php’s bootstrap method, create below alias

@webroot means your index.php path, in my sample, D:/xampp/htdocs/basic/web
@web is empty

Yii2 use spl_autoload_register to create autoload feature

Yii2 use spl_autoload_register to create autoload feature
yii2\Yii.php:

spl_autoload_register(['Yii', 'autoload'], true, true);
Yii::$classMap = require(__DIR__ . '/classes.php');
Yii::$container = new yii\di\Container();

classes.php file is generated, it contains a map just look like below:

return [
  'yii\base\Action' => YII2_PATH . '/base/Action.php',
  'yii\base\ActionEvent' => YII2_PATH . '/base/ActionEvent.php',
  ...
  'yii\web\Application' => YII2_PATH . '/web/Application.php',
  ...
];

so you can using below code to create a Yii2 class.
(new yii\web\Application($config))->run(); //Yii start from here, index.php

when implement autoload function for Yii2, there also implement the alias map
to prevent hard-code absolute paths or URLs.
example:

Yii::setAlias('@foo', '/path/to/foo');
Yii::setAlias('@foo/bar', '/path2/bar');
Yii::getAlias('@foo/test/file.php');  // displays: /path/to/foo/test/file.php
Yii::getAlias('@foo/bar/file.php');   // displays: /path2/bar/file.php

config apache and php in windows

1. download related apache and php
1.1 make sure the version is same with your host(x86 or x64)
1.2 download related vc version
PHP are built with VC9, VC11 or VC14 (Visual Studio 2008, 2012 or 2015
compiler respectively) and include improvements in performance and stability.
- The VC9 builds require you to have the Visual C++ Redistributable for
Visual Studio 2008 SP1 x86 or x64 installed
- The VC11 builds require to have the Visual C++ Redistributable for Visual
Studio 2012 x86 or x64 installed
- The VC14 builds require to have the Visual C++ Redistributable for Visual
Studio 2015 x86 or x64 installed
http://windows.php.net/download/
http://www.apachelounge.com/download/VC11/
2. php for windows need thread safe version
3. unzip apache and php to c:\
4. config php.ini
5. config httpd.conf
LoadModule php5_module “c:/php/php5apache2_4.dll”

section:
AddType application/x-httpd-php .php
let apache find php, add below line to the end of httpd.conf:
PHPIniDir “c:/php”
config index file:
DirectoryIndex index.php index.html
6. write one test.php file, put it under Apache htdocs dir, restart Apache,
using browser test it.
file content:
<?php phpinfo(); ?>
url:
localhost/test.php