Yii2 related learning records, download Yii2 (1), record yii2_PHP tutorial

WBOY
Release: 2016-07-12 08:56:01
Original
804 people have browsed it

Relevant learning records of Yii2, download Yii2 (1), record yii2

I originally learned the relevant knowledge of Yii1, although I half understood it, but the slight structure is Understood. Now I am using my evening time to learn how to use Yii2. I plan to build a backend management system. I will record it here to avoid forgetting it in the future.

I have read part of the authoritative guide of Yii2 so far. Although the Yiiframework Chinese website is authoritative, compared with the English version, some chapters are missing content, but I can still get a general understanding of what can be done. Please read it carefully when using a certain function. Of course, English is good It is recommended to read the English version, which is relatively new and comprehensive. By the way, I watched the "Stories to Tell with the Yii Framework" series of videos on MOOC.com, and they were very good.

What’s more important is that you need to use Google for FQ. After all, it is a foreign framework and there is relatively little content in Chinese. Most of the answers can be searched in Google. You can use XX-Net here. You can see how to use it yourself. Explain

The first is installation. The Yii2 advanced template is used here, and it is not recommended to use local. Now that you have composer, let’s learn new things:

1. Composer code repository, where you can find everything about Yii2. For example, enter "yiisoft/yii2-app-advanced" in the search box. This is the Yii2 advanced template we are looking for. This code base corresponds to github. You can check the github address in the upper right corner, and then check the instructions on how to install Yii2.

2. Download composer. Of course, due to the wall, composer may not work. You need to use Chinese images here. Some images have stopped updating. As of today (2016/03/27), the composer China full image is available. You should be able to use it according to the instructions.

After the above two components are configured, you should be able to use composer to download Yii2. Problems encountered during installation (under Windows system):

1. The following error will appear:

Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks<> ....
Copy after login

You can check this: https://github.com/yiisoft/yii2/issues/9794, that is, delete the "fxp" folder in the relevant directory, and then follow the steps again.

2. When installing under Windows, you may need to enter your github account password and token. This is to register a github account, and then go to "Personal Center"->"Settings"->"Personal access tokens" Just generate a token; if you encounter a situation where the 'git' command is not recognized, you need to download the github client and try it. If it doesn't work, you may need to add git to the environment variable

3. You may encounter this after the installation is complete:

<span>Invalid Parameter &ndash; yii\base\InvalidParamException
The </span><span>file</span> or directory to be published does not exist: E:\www\yii2\yii2test1/vendor\bower/jquery/dist
Copy after login

This may be when you enter a sentence similar to the following:

composer global require <span>"</span><span>fxp/composer-asset-plugin:~1.1.1</span><span>"</span>
Copy after login
The version number behind

is incorrect, resulting in an incorrect directory location. One way is to re-enter the correct version above, and then

composer self-<span>update
composer global update
composer update</span>
Copy after login

Another method is that the currently required files are under vendorbowerbower-asset, so copying the following jquery file to the previous directory can run normally. But it is best to use the first method. I don’t know if the second method has any side effects.

The installation is basically like this. Although it is very laborious, it is also good to learn new methods. Anyway, if you encounter problems, just go to Baidu or Google. I don’t know the specific usage of composer, so I’ll search for it when I need it. That's it, let's go play ball first, Koko!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1114013.htmlTechArticleRelated learning records of Yii2, download Yii2 (1), record yii2. I have previously learned relevant knowledge of Yii1, although it is also I don’t understand it half-heartedly, but I understand a little bit of the structure. Now take advantage of the evening...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template