[eluser]Unknown[/eluser]
I have my add() function in the controller..
Code:
function add(){
$this->load->model('FeedList');
$feedList = new FeedList();
$rs = $feedList->add( $_POST['url'] );
echo $rs;
}
When I call this function, I get this error:
Fatal error: Using $this when not in object context in C:\xampp\htdocs\RSS\system\application\models\FeedList.php on line 13
this is my feedList.php file:
Code:
class FeedList extends Model {
public function __construct(){
parent::Model();
}
public static function add( $url ) {
//bottom line I get error, getFeedByUrl()
if ( $this->getFeedByUrl( $url ) != null ) return "fail";
.
.
.
}
Anyway seems to be I cannot create a FeedList class inside of the FeedList class..
I already try construct() function it didnt work.
Can you tell me where I do wrong? Thanks..