Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
09-25-2003, 04:04 PM #1
OOP :: Not getting anything returnedPHP Code:
var $titles = array("index" => "Welcome",
"credits" => "Site credits");
09-25-2003, 04:10 PM #2
- Join Date
- May 2002
- Marion, IA USA
- Thanked 83 Times in 82 Posts
Did you ever create an instance of your object before you tried to access the functions in it?
variablename = new ObjectName();
CodingForums Supreme Overlord
All Hail Spookster
09-25-2003, 04:26 PM #3
- Join Date
- Jun 2002
- frankfurt, german banana republic
- Thanked 0 Times in 0 Posts
In your page_title() method, you don't use the parameter string as a key to reach the array element:
Spookster is right though that you have to create an instance of the object somewhere. You can't even use a static all in your sample code, because you rely on the class variable $this->titles.PHP Code:
De gustibus non est disputandum.
09-25-2003, 04:27 PM #4
I think I should've read a different tutorial THe one I read didn't mention that. All fixed now, ta
<edit>It's not gonna be used for anything this class, I'm just playing with it. After I've played a bit, I'll try and make something more useful and flexible</edit>
Last edited by Nightfire; 09-25-2003 at 04:34 PM.