Install extension using composer in yii2.0
Asked Answered
H

3

6

How can i install yii/jui in yii2.0 using composer. I have tried

php composer.phar require --prefer-dist yiisoft/yii2-jui "*"

and added to composer.json

"yiisoft/yii2-jui": "*"

but it did not succeed. Can anyone help me how to use composer to install extension in yii 2.0 .

When i am running $ php composer.phar require yiisoft/yii2-jui "*" in cmd it is just opening the composer.phar file, nothing else happening.

Thank you in advance.

Holmic answered 5/1, 2015 at 14:41 Comment(0)
H
12

Please check in composer.json file for yiisoft/yii2-jui under "require". You might be see like that

"require": {
        "yiisoft/yii2-jui": "2.0.*@dev"
},

If you didn't see, please add this and run composer.phar install or composer install. If already install, use composer.phar update or composer update

I have been updated my answer. Please take a look. The packagist is Here.

Hop answered 5/1, 2015 at 15:11 Comment(6)
Hello kelvin i am not able to create yiisoft/yii2-jui folder. So help me first to create yii2-jui folder inside yiisoftHolmic
No need to create folder that using composer.Hop
So how i will get yiisoft/yii2-jui folder. By using php composer.phar require --prefer-dist yiisoft/yii2-jui "*" just opening composer.phar file . Plz help me .Holmic
i am talking about github.com/yiisoft/yii2-jui plz look in the installation section i am using php composer.phar require --prefer-dist yiisoft/yii2-jui "*" to install yii2-jui but it isopening just composer.phar file. so help me to install yiisoft/yii2-jui through composer.Holmic
for me composer. phar update or composer.update didn't work. I used php composer.phar updateCardcarrying
@Cardcarrying Where your composer.phar location? Type this command which composerHop
H
9

Hopefully, you already installed Yii-2 with composer. I have been installed (basic application template) step by step.

Step 1. Before installation, Yii official website said that, we require to install this package before installation Yii 2. This step will follow after composer installation.

sudo composer global require "fxp/composer-asset-plugin:1.0.0-beta4"

Please take a look attach file.

enter image description here

This time is yii-2 installation with composer.

sudo composer create-project yiisoft/yii2-app-basic basic 2.0.1 

Please take a second and third attach image.

enter image description here

enter image description here

After that, please go to your project folder. Then, open your_project_folder/composer.json. I have been used vi to open compser.json. You can use whatever your prefer. Please take a look again for attach image.

enter image description here

The next step is final step for complete install for your package. After adding this

"yiisoft/yii2-jui": "*" 

under require keyword, please save your composer.json file. Then run this command.

 sudo composer update

Please take a look attach image again.

enter image description here

Please check your folder on your_project_folder/vender/yiisoft/yii2-jui

enter image description here

That's all. Hope this help for your stack. Btw, if you want to use composer command, please used the following command. This will help to call composer from everywhere.

sudo mv composer.phar /usr/local/bin/composer
Hop answered 7/1, 2015 at 8:10 Comment(0)
F
0

I use Windows 10, To install php composer.phar requires --prefer-dist yiisoft/yii2-jui.

Findley answered 2/8, 2018 at 4:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.