Noticed, it works, thank you both, Great Devs.
Cheers
Search found 5 matches
- Tue Nov 17, 2009 8:35 am
- Forum: PHP - Code
- Topic: oop matter
- Replies: 8
- Views: 295
- Tue Nov 17, 2009 7:19 am
- Forum: PHP - Code
- Topic: oop matter
- Replies: 8
- Views: 295
Re: oop matter
$json_res only exists within your public function getPage($page_id) function. So either you initiate the var in the constructor or: echo $p->getPage($page_id); not really mate, $json_res is declared as public property in the beginning of the class pages.php and been accessed as normal within testin...
- Tue Nov 17, 2009 7:14 am
- Forum: PHP - Code
- Topic: oop matter
- Replies: 8
- Views: 295
Re: oop matter
I don't really think this the problem 'cos getPage() function should be called automatically by the constructor when the object is created. What do you mean? The constructor wont call any methods unless you tell it to, and as getPage is commented out, getPage is never being called. Try it out yours...
- Tue Nov 17, 2009 6:31 am
- Forum: PHP - Code
- Topic: oop matter
- Replies: 8
- Views: 295
Re: oop matter
I don't really think this the problem 'cos getPage() function should be called automatically by the constructor when the object is created.iankent wrote:I think its because this line is commented out:in your example, nothing is calling getPage so $json_res is never filledCode: Select all
//$this->getPage($page_id);
- Tue Nov 17, 2009 5:52 am
- Forum: PHP - Code
- Topic: oop matter
- Replies: 8
- Views: 295
oop matter
I wonder if there is nayone there, could help me with this issue, I have class called pages that suppose to query the abstract data layer and get the result as an array and then the class transform this result into json. I created a testing class to instantiate this class and print the result. Howev...