Im working on my first project in CodeIgniter and I wonder How can I use my class from library in my Controller.
libraries/Twitterclass.php:
PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Twetterclass {
public function __construct($hashtag, $tweet_id)
{
require_once('TwitterAPIExchange.php');
//There is my working code
//I want to make use of this $n in my Controller
return $n;
}
}
/* End of file Twetterclass.php */
My Controller:
PHP Code:
public function microtweets()
{
$params = array('hashtag' => 'somehashtag', 'tweet_id' => '673899616799191040');
$data['count_tweets'] = $this->load->library('Twetterclass', $params);
$this->load->view('tweets', $data);
}
I want to use his extended class in my controller and work there on this $n value or for example display it in my View.
I got few errors in my view for example:
Quote:A PHP Error was encountered
Severity: Warning
Message: Missing argument 2 for Twetterclass::__construct(), called in /coinmonitor/system/core/Loader.php on line 1246 and defined