包括yii2的其他库 [英] Include additional library to yii2

查看:76
本文介绍了包括yii2的其他库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

yii2 通过作曲家安装。应该采取哪些特定步骤将附加库库连接到当前项目。如果只需要连接简单的类,也会出现同样的问题。

There is yii2 which instaled via composer. What specific steps should be taken to connect the additional library library to the current project. Also same question if need connect only simple class.

推荐答案

https://getcomposer.org 是向yii2框架添加新库时最好的朋友。

Composer found at https://getcomposer.org is your best friend while adding new libraries to yii2 framework.

例如您想将在 http://demos.krajee.com/ 中找到的kartik yii2小部件添加到yii2应用程序中

e.g. you would like to add kartik yii2 widgets found at http://demos.krajee.com/ to your yii2 application.


  1. ,因为您需要在开发计算机中安装php并通过命令行对其进行访问。
    例如从命令行执行以下命令以检查php版本。




php -v

php -v

如果可以正常工作,如果没有,则需要设置路径变量。

if it works then fine, if not, that you need to set path variable.


  1. https://getcomposer.org

  2. 将composer.phar复制到该目录。

  3. 使用 CD 通过命令提示符转到yii2应用程序文件夹

  4. 从命令行执行以下命令

  1. download composer.phar from https://getcomposer.org
  2. copy composer.phar to that directory.
  3. go to yii2 application folder using CD through command prompt
  4. execute following command from command line




php composer.phar require kartik-v / yii2-widgets *

php composer.phar require kartik-v/yii2-widgets "*"




  1. 现在坐下观看

要简单地连接并使用任何自定义类,请遵循本指南。
http:// www.yiiframework.com/wiki/747/write-use-a-custom-component-in-yii2-0/

To simply connect and using any custom class, follow this guide. http://www.yiiframework.com/wiki/747/write-use-a-custom-component-in-yii2-0/

Yii是mvc框架,它具有与模型,视图,控制器连接和使用的特定方法。
点击此链接可找到更多的
http:/ /www.yiiframework.com/doc/guide/1.1/en/basics.mvc

Yii is mvc framework and it has specific methodology to connect and use with model, view, conntroller. Follow this link to find more http://www.yiiframework.com/doc/guide/1.1/en/basics.mvc

这篇关于包括yii2的其他库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆