Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install extensions through Composer in YII2 Framework

Shulou Source: shulou.com Published: 2022-06-03 17:54:25 11月13日 Update

This article will explain in detail how to install extensions through Composer in the YII2 framework. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

For example: install the plug-in yii2-detail-view through Composer.

Git

It is recommended that Git Clone be used when installing the Git,Composer installation plug-in

If you do not have Git,CMD installed, it will prompt you that git is not a valid command when executing the command. Then find the download address of the hard drive. In fact, it doesn't matter if you don't install git.

After installing Git under Windows, configure the environment variable and add; D:\ Program Files\ Git\ bin to the Path environment variable.

Installation method

Yii2-detail-view

Official statement:

Installation The preferred way to install this extension is through composer.Either run:$ php composer.phar require kartik-v/yii2-detail-view "*" or add: "kartik-v/yii2-detail-view": "*" to the require section of your composer.json file.

This is compared to the installation method in Linux environment, and Composer is used in Windows.

Execute the command under CMD: composer require kartik-v/yii2-detail-view "*"

After installation, we will see that during the installation process, five other plug-ins are installed, all of which are dependent on yii2-detail-view.

This is the advantage of the Composer tool, which automatically analyzes dependencies and helps us to install them perfectly.

See the "kartik-v" directory under the webroot/appname/vendor directory. See that there are 6 directories under the path. Indicates that the installation was successful.

This is the end of this article on "how to install extensions through Composer in the YII2 framework". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Tags: Plug-ins commands environments directories articles frames variables methods more help good practical effective successful content address official actually is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Information Docker vpn Microsoft