How to use composer packages in codeigniter?

2019-01-16 17:35发布

I've followed this article: http://philsturgeon.co.uk/blog/2012/05/composer-with-codeigniter

But I get Fatal error: Class 'Buzz\Browser' not found.

What is missing from his post?

My controller or application isn't namespaced. I was hoping to just be able to use that one package in one controller's action in a non-namespaced framework.

7条回答
Animai°情兽
2楼-- · 2019-01-16 17:59

You can add directly the Composer Autoloder in your controller:

// Composer Autoloader
require FCPATH.'vendor/autoload.php';
查看更多
登录 后发表回答