Table of Contents
Yii2的相关学习记录,下载Yii2(一),记录yii2
Home php教程 php手册 Yii2的相关学习记录,下载Yii2(一),记录yii2

Yii2的相关学习记录,下载Yii2(一),记录yii2

Jun 13, 2016 am 08:43 AM
php5

Yii2的相关学习记录,下载Yii2(一),记录yii2

原先学习过Yii1的相关知识,虽然也是半懂不懂的,但稍微的结构是了解的。现在利用晚上的时间学习下Yii2的使用,打算建一个后台管理系统,这里记录下,以免自己以后忘记。

目前已看一部分Yii2的权威指南,虽然Yiiframework中文网站的权威,跟英文版本比较有些章节缺失内容,但也能大体了解具体能做什么,用到某功能时再仔细看,当然英文好的还是建议看英文版本的,比较新,比较全。顺便看了慕课网上的“与Yii框架不得不说的故事”系列视频,讲的非常不错。

还有比较重要的是需要FQ用google,毕竟是国外的框架,中文的内容比较少,大部分解答都能在谷歌中搜索到,这里可以用XX-Net,具体的如何用自己看说明吧

首先是安装,这里用的Yii2高级模板,而且不建议用本地,既然有了composer就学习下新事物吧:

1、composer代码仓库,在这里可以找到Yii2的所有东西,好比在搜索框中输入“yiisoft/yii2-app-advanced”,这个就是我们要找的Yii2高级模板。这个代码库是和github对应着的,可以查看右上角的github地址,然后查看说明如何安装Yii2。

2、下载composer,当然,由于墙的原因,用composer可能会没法用。这里需要用到中国镜像,有些镜像已经停止更新了,截至今天(2016/03/27),可用的是这个composer中国全量镜像,照使用说明来应该就可以用了。

上面两部配置好后应该就可以用composer下载Yii2了。安装遇到的问题(windows系统下):

1、会出现下面的错误:

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

可以查看这个:https://github.com/yiisoft/yii2/issues/9794,也就是删除相关目录下的“fxp”文件夹,再重新按步骤来下。

2、windows下安装时,一种情况有可能要输入github账号密码和token,这个就是注册github账户,然后在“个人中心”->“Settings”->"Personal access tokens"中来生成个token就行了;还遇到一种情况提示‘git’命令不识别,那就需要下载github的客户端试试,不行可能还需要git加入环境变量中

3、安装完成后可能会遇到这个:

<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

这个可能是当时输入下面类似语句时:

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

时后面的版本号不对,导致目录位置错误,一种方法是可以重新输入上面正确的版本,然后

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

另一种方法也是当前需求的文件在vendor\bower\bower-asset下,所以将下面的jquery文件拷贝到上一个目录下也可以正常运行。但是最好是用第一种方法,第二种不知道有没有副作用。

安装基本上就这样了,虽然很费劲,但是学习下新的方法也是不错的,反正遇到问题就百度或者谷歌走起。具体的composer用法,自己也没掌握,用到时再搜索吧。就这样,先去打球去了,科科!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the difference between php5 and php8 What is the difference between php5 and php8 Sep 25, 2023 pm 01:34 PM

The differences between php5 and php8 are in terms of performance, language structure, type system, error handling, asynchronous programming, standard library functions and security. Detailed introduction: 1. Performance improvement. Compared with PHP5, PHP8 has a huge improvement in performance. PHP8 introduces a JIT compiler, which can compile and optimize some high-frequency execution codes, thereby improving the running speed; 2. Improved language structure, PHP8 introduces some new language structures and functions. PHP8 supports named parameters, allowing developers to pass parameter names instead of parameter order, etc.

How to change port 80 in php5 How to change port 80 in php5 Jul 24, 2023 pm 04:57 PM

How to change port 80 in php5: 1. Edit the port number in the Apache server configuration file; 2. Edit the PHP configuration file to ensure that PHP works on the new port; 3. Restart the Apache server, and the PHP application will start running on the new port. run on the port.

How to solve the problem that php5 is not listening on port 9000 How to solve the problem that php5 is not listening on port 9000 Jul 10, 2023 pm 04:01 PM

Solution steps for php5 not listening to port 9000: 1. Check the PHP-FPM configuration file; 2. Restart the PHP-FPM service; 3. Turn off the firewall or configure port forwarding; 4. Check whether other processes occupy port 9000.

What is the difference between php7 and php5 syntax What is the difference between php7 and php5 syntax Jul 10, 2023 pm 03:25 PM

The syntax differences between php7 and php5 are: 1. PHP7 introduces strict type declarations, while the type of PHP5 variables is implicit; 2. PHP7 introduces support for scalar type declarations, but PHP5 does not; 3. PHP7 introduces NULL Merge operator, while PHP5 checks whether a variable exists and is not null, you need to use a conditional statement; 4. PHP7 adds a new comparison operator "<=>", but PHP5 does not; 5. PHP7 introduces a new feature anonymous class , while PHP5 does not.

What are the differences between the version of php7 and 5? What are the differences between the version of php7 and 5? Sep 15, 2023 pm 04:11 PM

The differences between the version of php7 and 5 include performance improvements, scalar type declarations, return value type declarations, exception handling improvements, anonymous classes, syntax improvements, new operators, enhanced error handling and the removal of some old features. Detailed introduction: 1. Performance improvement. PHP7 introduces a new Zend engine, named Zend Engine 3.0, which brings significant performance improvement. The performance of PHP7 is approximately twice that of PHP5, mainly through improved memory management. , optimized function calls and exception handling, enhanced garbage collection, etc.

How to solve the problem that php5 is not listening on port 9000 How to solve the problem that php5 is not listening on port 9000 Mar 21, 2023 pm 04:32 PM

When using PHP5, some users may encounter the situation that port 9000 cannot be listened to. At this time, we need to perform some configuration and troubleshooting work to solve this problem.

How to change port 80 in php5 How to change port 80 in php5 Mar 21, 2023 pm 04:32 PM

​If you are a website administrator, you may encounter a situation where you need to change the PHP5 port from the default port 80. This process may be a little hurried, but as long as you follow the steps below, it will be easily completed.

Discuss the syntax differences between PHP7 and PHP5 Discuss the syntax differences between PHP7 and PHP5 Mar 21, 2023 pm 07:10 PM

PHP is a widely used server-side programming language used to develop dynamic websites and applications. In recent years, the release of PHP7 has attracted some attention. PHP7 has many improvements and optimizations over previous versions (such as PHP5). In this article, we will explore the syntax differences between PHP7 and PHP5.

See all articles