Welcome Guest, Not a member yet? Register   Sign In
How to use thid party?
#1

Hi people. I was looking for a "link preview", https://github.com/kasp3r/link-preview . I was thinking that I can insert that in third_party, and call all by a custom library, but it is the first time for me.

So, I downloaded all and inserted the files here: application/third_party/LinkPreview/...

My question is: how can I use it now? I created a class like that:

PHP Code:
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class 
linkPreview {
 
   public function __construct()
 
   {
 
       require_once APPPATH.'third_party/LinkPreview/LinkPreview.php';
 
   }
 
   
    public 
function link(){
 
       $var = new LinkPreview("http://facebook.com");
 
       return $var;
 
   }


but if in a controller I include the library
PHP Code:
$this->load->library('linkPreview'

and then I call in this way:
PHP Code:
$this->linkPreview->link() 

I've this errors:
[Image: f3c988b711740f41dc8e491337231c35.png]

Can you give me some ideas?

Thank you!
Reply
#2

See: https://www.codeigniter.com/user_guide/l...ckage_path
Reply
#3

Yeah, I tried also that, but when I create a var $var = new LinkPreview("http://facebook.com"); I have this error:

[Image: 4b5e154e2e66dcb9c341ea3f4d33640e.png]

and this is my code:

[Image: c9cf63406c24bd21526b05c60a8d3cbd.png]
Reply
#4

CodeIgniter: Access Third Party Libraries
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB