简体   繁体   English

Yii2安装扩展

[英]Yii2 installing extensions

Hi, I have just installed a Yii2 basic project from composer. 嗨,我刚刚从composer安装了一个Yii2基本项目。 I'm in mac osx yosemite 10.10. 我在Mac OS X优胜美地10.10中。 Neverthless i'm trying to install extensions as descrived in the tutorials from Yii guide 2.0 and i cannot do it, simply to the fact that i don´t know where to put the line: 没什么,我试图按照Yii guide 2.0的教程中的说明安装扩展程序,但我做不到,只是因为我不知道在哪里写:

php composer.phar require --prefer-dist arturoliveira/yii2-tileslidemenu "*" php composer.phar需要--prefer-dist arturoliveira / yii2-tileslidemenu“ *”

this method says in terminal it cannot find composer.phar. 此方法表示在终端中找不到composer.phar。 Where to put the above line ? 上面的线放在哪里?

When i installed the project "acastro" i wrote in terminal the line: composer create-project --prefer-dist yiisoft/yii2-app-basic acastro 当我安装项目“ acastro”时,我在终端写了一行:composer create-project --prefer-dist yiisoft / yii2-app-basic acastro

and the installation worked very well (i had to deal with the mcrypt missing error first but then composer was recognized as a command by termnal) 并且安装效果很好(我必须先处理mcrypt丢失的错误,但之后termos将composer识别为命令)

So, what is the issue here, since nothing installs in vendors dir? 那么,这里的问题是什么,因为在供应商目录中没有安装任何东西?


I have tried the other method but nothng happens. 我尝试了其他方法,但没有发生。 The method was: 该方法是:

"arturoliveira/yii2-tileslidemenu": "*" “ arturoliveira / yii2-tileslidemenu”:“ *”

added in the required section of composr.json file. 添加在composr.json文件的必需部分中。

When i launch the project by localhost MAMP, nothing is installed in vendors dir. 当我通过localhost MAMP启动项目时,供应商目录中未安装任何内容。


Anyone can explain me how to install the proper way an extension in Yii2. 任何人都可以向我解释如何在Yii2中正确安装扩展。 In Yii1.1 was so easy to do it. 在Yii1.1中是如此容易做到。

Many thanks in advance. 提前谢谢了。

So if you have global installation of composer and you do composer create-project --prefer-dist yiisoft/yii2-app-basic acastro , than you can do same with that line too: 因此,如果您已经在全球范围内安装了composer,并且执行了composer create-project --prefer-dist yiisoft/yii2-app-basic acastro ,那么您也可以在该行中进行相同的操作:

composer require --prefer-dist arturoliveira/yii2-tileslidemenu "*"

I don't use MAMP, only XAMPP, but as far as I know, you have to manually do composer actions via command line. 我不使用MAMP,仅使用XAMPP,但据我所知,您必须通过命令行手动执行作曲家操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM