View Single Post
  #1 (permalink)  
Old 10-13-08, 09:13 AM
in2mobi in2mobi is offline
Newbie Coder
 
Join Date: Mar 2008
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Problem with sub class

I am trying to access the methods of my primary class in its subclass, but I seem not to be able to grab their values from the primary class. When I echo out the values in the primary class they seem to be their, but when I try to access them in the sub class they do not appear. Here is the code for the primary class and what I have for the subclass so far.
PHP Code:

<?PHP
class directoryStructure{
//server root
const server_root ='c:/wamp/www/';    
//ugmusic.biz root folder    
const ugmusic_root ='c:/wamp/www/ugmusic.biz/';
//member.ugmusic.biz (1st.Root, 2nd.content_creator, 3rd.content_seeker )
const member_ugmusic_root ='c:/wamp/www/member/';
const 
member_ugmusic_cc ='c:/wamp/www/member/content_creator/';
const 
member_ugmusic_cs ='c:/wamp/www/member/content_seeker/';
//mobile.ugmusic.biz (1st.Root), users folder is created upon completion of form    
const mobile_ugmusic_root ='c:/wamp/www/mobile/';    
    

function 
getServerRoot(){
    return 
self::server_root;
}

function 
getUgmusicRoot(){
    return 
self::ugmusic_root;
}

function 
getMemberRoot(){
    return 
self::member_ugmusic_root;
}

function 
getMemberCC(){
    return 
self::member_ugmusic_cc;
}

function 
getMemberCS(){
    return 
self::member_ugmusic_cs;
}

function 
getMobileRoot(){
    return 
self::mobile_ugmusic_root;
}

}
//closes class

?>





<?php
require_once"c:\wamp\www\ugmusic.biz\php_files\classes\class.directoryStructure.php";

class 
createUserDir extends directoryStructure{
    
        
function 
_construct($aUsersName$clientUserType){
        
$this->user_dir_name $aUsersName;
        
$this->client_type $clientUserType;
        
$this->root_server parent::getServerRoot();
        
$this->ugmusic_root parent::getUgmusicRoot();
        
$this->member_root parent::getMemberRoot();
        
$this->content_creator parent::getMemberCC();
        
$this->content_seeker parent::getMemberCS();
        
$this->mobile_root parent::getMobileRoot();
    }
    
    
    
    
    
    
    
    
}                                    
/*CLOSES class createUserDir*/

                                            /*TEST AREA*/
$test2 = new createUserDir("hello","content");
$mytest $test2->ugmusic_root;
echo 
"$mytest";

?>
in the subclass createUserDir I cannot access the primary classes values. Any help is great.

Last edited by Nico; 10-13-08 at 09:14 AM. Reason: Wrappers.
Reply With Quote