我怎样包括codeIgniter外部库? [英] How do I include external Libraries in CodeIgniter?

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

问题描述

我是新来的codeigniter,我试图亚马逊的FPS整合到我的网页。有一帮库和模型,与亚马逊的FPS,这我需要包括进行适当的电话去了。

I'm new to codeigniter, and I'm trying to integrate amazon's FPS into my page. There are a bunch of libraries and models that go with Amazon FPS, which I would need included to make the appropriate calls.

我如何将它们包含在codeIgniter?

How do I include them in CodeIgniter?

我试图把整个亚马逊文件夹中的系统/库目录中,然后尝试包括$这个 - >负载>库(亚马逊/ FPS /客户端')的库; 不过,我碰到问题的相对路径那里,因为Client.php包含语句require_once('亚马逊/ FPS / Interface.php'); ......这是在同一个文件夹中。

I tried placing the entire Amazon folder inside the system/libraries directory, and then tried including libraries with $this->load->library( 'Amazon/FPS/Client' ); However, I run into problems with the relative path there, because Client.php contains the statement require_once ('Amazon/FPS/Interface.php'); ... which is in the same folder.

必须有一个更好的方式来做到这一切的? - 任何人都可以请帮助

There has to be a better way to do all this - can anyone please help?

谢谢!

推荐答案

没有什么直接包括类,并与他们一起工作阻止你,但是你会在一个香草PHP安装。如果它工作在PHP它会在codeIgniter。

There is nothing stopping you from directly including classes and working with them however you would in a vanilla PHP setup. If it works in PHP it will work in CodeIgniter.

include(APPPATH.'libraries/Amazon/FPS/Interface.php');

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

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