Yii2 learning history, download Yii2 (1)-roaming cloud previously learned Yii1 related knowledge, although also half understand, but a little understanding of the structure. Now I want to learn how to use Yii2 at night and plan to build a background management system. here I will record it to avoid forgetting it later.
At present, I have read some authoritative guides of Yii2. although the authority of the Yiiframework Chinese website has some missing chapters compared with the English version, I can also get a general idea of what I can do. I should take a closer look when using a function, of course, if the English version is good, we recommend that you read the English version. it is relatively new and comprehensive. By the way, I watched the MOOC online series of "stories that have to be told by Yii Framework" and spoke very well.
What's more important is that google is needed for FQ. after all, it is a foreign framework with fewer Chinese content. most of the answers can be found in google, where XX-Net can be used, let's take a look at the specifics.
First, install the Yii2 advanced template. We do not recommend using the local template. now that you have composer, learn new things:
1. composer code repository, where you can find everything in Yii2, like entering "yiisoft/yii2-app-advanced" in the search box, this is the Yii2 advanced template we are looking. This code library corresponds to github. you can view the github address in the upper-right corner and view instructions on installing Yii2.
2. download composer. of course, you may not be able to use composer because of the wall. Here we need to use a Chinese image. Some images have been updated. as of today (), this composer Chinese full image is available, which should be ready for use according to instructions.
After the above two configurations, you can use composer to download Yii2. Installation problems (in windows ):
1. the following error occurs:
Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks<> ....
You can view this: example.
2. During windows installation, you may need to enter the github account password and token. this is to register a github account, you can generate a token in "Personal center"> "Settings"> "Personal access tokens". you also encounter a situation where the 'Git 'command is not recognized, you need to download the github client. if not, you may need to add git to the environment variable.
3. this problem may occur after the installation is complete:
Invalid Parameter – yii\base\InvalidParamExceptionThe file or directory to be published does not exist: E:\www\yii2\yii2test1/vendor\bower/jquery/dist
This may be when the following statement is entered:
composer global require "fxp/composer-asset-plugin:~1.1.1"
If the version number is incorrect, the directory location is incorrect. One way is to re-enter the correct version, and then
composer self-updatecomposer global updatecomposer update
Another method is to store the files that are currently required in the vendor \ bower-asset directory. Therefore, you can copy the following jquery files to the previous directory and run them normally. But it is best to use the first method, and the second method does not know whether there are any side effects.
The installation is basically like this. although it is very difficult, it is also good to learn the new method. baidu or google will start to solve any problem. I am not familiar with the specific usage of composer. I will try again later. In this case, I went to play the ball first, Coke!