Include class in class |
[eluser]freshface[/eluser]
Is this possible to do? Like this: Code: <?php
[eluser]Dam1an[/eluser]
Yeah, although your example is assuming it's in the same directory If not, just use the defined var APPPATH to build the correct include path
[eluser]freshface[/eluser]
It works But now i want to do this: Code: <?php But i got an error on $this->snoopy->fetchlinks($page); Fatal error: Call to a member function fetchlinks() on a non-object in
[eluser]Dam1an[/eluser]
a) Does it work if you create the snoopy object in the extract function and call the copy local to that function b) What do you get when you do print_r on the snoopy object as soon as it's created, and just before you try to access it in the execute function
[eluser]freshface[/eluser]
If i create the snoopy object inside extract there is no problem. I just want one object so the object is available over the whole class. print_r doesn't seem do give any feedback.
[eluser]Dam1an[/eluser]
I spotted it You have a typo in the constructor, it should be __construct
[eluser]Dam1an[/eluser]
[quote author="TheFuzzy0ne" date="1245544636"]I blame Bill Gates...[/quote] Care to explain, cause this sounds like it could be good lol
[eluser]freshface[/eluser]
Thanks Dam1an. This is the thing i am working on: a little class that sniffs a whole site for links inside the same domain. I still have a logic problem i am working out. care to take a look and help? zip: http://www.figure8.be/problem.zip
[eluser]Dam1an[/eluser]
Here's a little tip, when asking people for help, it's good to be as specific as possible. The less thinking/time wasting the other person needs to do to figure out whats going on, the better, and more likely they will help lol So instead of saying you have a logic problem, say which file, function, maybe even line number if it's a mamoth function |
Welcome Guest, Not a member yet? Register Sign In |