NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page OOP Sharing Values

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 07-21-2006, 03:24 AM THREAD STARTER               #1 (permalink)
NamePros Member
 
blacksnday's Avatar
Join Date: Jun 2006
Location: ohio
Posts: 26
blacksnday is an unknown quantity at this point
 



OOP Sharing Values


I was wondering how to share values between one class and an extension of it, where the value would first be assigned by the main class and be used by the extension after being assigned?

if that confuses you, here is an example of what I am trying to do:

PHP Code:
class SomeClass {

function 
someFunction($assign_me=' '){

$assign_me == FALSE $assign_me ' ' $assign_me "IMASSIGNED";
}

}

class 
AnotherClass extends SomeClass{

function 
isAssigned(){
if(
$assign_me "IMASSIGNED"){
echo 
"It Has Been Assigned";
}

}

__________________
WHERE'S MY RUM?!!
((in your hand...))
OH!
blacksnday is offline  
Old 07-21-2006, 04:27 AM   #2 (permalink)
NamePros Regular
 
-PS-'s Avatar
Join Date: Jun 2006
Location: Sydney
Posts: 251
-PS- will become famous soon enough-PS- will become famous soon enough
 



Originally Posted by blacksnday
I was wondering how to share values between one class and an extension of it, where the value would first be assigned by the main class and be used by the extension after being assigned?

if that confuses you, here is an example of what I am trying to do:

PHP Code:
class SomeClass {

function 
someFunction($assign_me=' '){

$assign_me == FALSE $assign_me ' ' $assign_me "IMASSIGNED";
}

}

class 
AnotherClass extends SomeClass{

function 
isAssigned(){
if(
$assign_me "IMASSIGNED"){
echo 
"It Has Been Assigned";
}

}

personaly i'm not sure, but the if($assign_me = "IMASSIGNED") in the extended bit is going to be messing up your testing, as the = will be assigning the vaule, not checking it like ==/=== does
-PS- is offline  
Old 07-21-2006, 05:47 AM   #3 (permalink)
NamePros Regular
 
Noobie's Avatar
Join Date: Feb 2006
Location: Montreal, Quebec, Canada
Posts: 324
Noobie is on a distinguished road
 



PHP Code:
class SomeClass 
var 
$bla ='';
function 
someFunction($assign_me=' '){ 

$assign_me == FALSE $this->bla ' ' $this->bla"IMASSIGNED"




class 
AnotherClass extends SomeClass

function 
isAssigned(){ 
if(
$this->bla "IMASSIGNED"){ 
echo 
"It Has Been Assigned"
????: NamePros.com http://www.namepros.com/programming/219326-oop-sharing-values.html




I think is what u need
__________________
Goldkey.com is a scam
What's your BMI? | Timestamp Generator
Noobie is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:15 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger