Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to a member function query() while my class extends controller
#3

[eluser]Unknown[/eluser]
I think Ive explained it in wrong way.
I've created an Library Class named Page that I'm calling in on page News.
Class Page creates skeleton for my whole Page.
In News I'm only inserting main content and title.
Problem was in Page class which I was extending with Controller and that was bad idea.
I forgot that in CodeIgniter manual is written:
Quote:$this, however, only works directly within your controllers, your models, or your views. If you would like to use CodeIgniter's classes from within your own custom classes you can do so as follows:

First, assign the CodeIgniter object to a variable:
$CI =& get_instance();
And that was my problem.
You are saying that this code belongs to a model.
It isn't my first experience with MVC but you are maybe right that I'm a little confused.
Can you tell me then where this code belongs and how should I use it ?

And if it comes to manual and video tutorials I've passed trough them before I've started to use CodeIgniter Tongue


Messages In This Thread
Fatal error: Call to a member function query() while my class extends controller - by El Forum - 06-21-2007, 10:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB