Jump to content


Photo

Classes - Extend


  • Please log in to reply
4 replies to this topic

#1 kyle2005

kyle2005
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 28 March 2006 - 03:32 PM

Hi all,

I am new to the class business and would like to find out how I will be able to do the following.

Let’s say my class structure looks as follows.

account.php

account/make.php
account/del.php
account/edit.php
account/login.php
account/logout.php

And I have a main class called account { }

And each time I need to make a new account I just use the acc_make extend account

But how does that work.

Any one with time that might have a site that explains this or any help would be nice.

Thanks

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 28 March 2006 - 03:46 PM

I haven't dealt with extending, so you might just have to ignore my answer (and maybe explain your class a little better)... but why wouldn't you just create a new instance of the class for a new account?

Info: PHP Manual


#3 kyle2005

kyle2005
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 28 March 2006 - 03:51 PM

That is one way of doing it,

But I am sort off trying to do what the pear packages are doing, with the extend.

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 28 March 2006 - 04:43 PM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]But I am sort off trying to do what the pear packages are doing, with the extend.[/quote]
Why?

I meen really... If you dont understand OOP concepts, then just trying to do something without understanding the why wont help.

Id'e recommend googling for the book thinking in java. It is a great resource for learning OOP concepts, and java's syntax really isn't too far removed from php's.

#5 kyle2005

kyle2005
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 29 March 2006 - 05:34 AM

Thank you,

Now that’s a step in the right direction.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users