|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Great Article!
I read about classes in 2 php books and after understanding nothing from them I decided to give up on classes but I read this article and know I CAN SEE !!! I know understand classes.
<br> |
|
#17
|
|||
|
|||
|
Referring to function from different includes
Hello,
I have a question! Q: I have many include files but I can't get them to interact with each other. For example...function abc in include file 1.inc can't make use of function xyz in include file 2.inc. How do I resolve this? Do you suggest having more than one include file? Or should I only have one large one? Thank you in advance. Piet |
|
#18
|
|||
|
|||
|
a note on inheritence...
I skimmed through the article, as I consider myself a decent PHP programmer, however I did notice one thing I'd like to remind all you potential guru's of.
Unlike some languages, when you extend a current class, and the class you are extending has a constructor function, the NEW class does not automatically call the constructor of the old class. Instead, if the old constructor function is needed in the new class, you must add a new constructor function for the new class that calls the old constructor function. Examples follow: <!-- Code --> <p><pre><font color=#008000><xmp> <?php class mammal { var $legs; function mammal() { //this is the constructor code $legs = 4; } } //This will not inherit the old constructor // values: class horse extends mammal { funtion run() { //whatever } } //This will: class cheetah extends mammal { function cheetah() { $this->mammal(); //this calls the constructor of the // parent class } function run() { //again, duh } } ?> </xmp></font></pre><p> <!-- Code --> I hope this helps... it's important stuff :) -S |
|
#19
|
|||
|
|||
|
GOOD but missed
This is a well decorated document, the best of all it illustrate the code in 'English', this the new kid like me to learn more easily. The only part it miss, is the sample output. Yes some sample output will give a clearer idea what is happening.
I also notice that writing comment in this site is easy, that is a good point it. thanks alot |
|
#20
|
|||
|
|||
|
Re: Do I really need class?
yea i think the same i'd really like to know what classes are really good for cuz i dont see it yet
|
|
#21
|
|||
|
|||
|
Re: Great Article!
I have to agree. I have also tryed to read som books abaut class but the chapters with classes are always too small and dont explain much to me.
|
|
#22
|
|||
|
|||
|
Re: .php4??? NOoooo!!!
Mike, please elaborate.
httpd.conf is easily changed to support other extensions. |
|
#23
|
|||
|
|||
|
U guys F***n' rock!!
U guys F***n' rock!!
U guys F***n' rock!! U guys F***n' rock!! |
|
#24
|
|||
|
|||
|
Re: U guys F***n' rock!!
Violetta
|
|
#25
|
|||
|
|||
|
coment
Hey, I don't know what is going on here but I sure what to find out
|
|
#26
|
|||
|
|||
|
Re: Do I really need class?
Well, I know where I use classes, when I had a DB class and want to have different functions for each database type: mysql, postgresql, mssql, whatever, for an example look here (you can even 'dynamically load' them):
php.weblogs.com (dunno why they called it adodb though) |
|
#27
|
|||
|
|||
|
PHP4 session class
Great article. I signed up for devshed
email list because of it. Could you do an article on the new feature of PHP4, session tracking / variables. Thanks. |
|
#28
|
|||
|
|||
|
Finally, I C
Well after 6 months of reading about classes in books and on web sites and mail postings... now I understand. Started reading this article not really sure and now it's crystal.
Thanks I C arus... |
|
#29
|
|||
|
|||
|
Readable articles
How the heck do the visitors of this site read these articles? There isn't any code formatting. Also, it would be nice to see some consistency in them, for example you have a wrong example and a right one, yet you use them both as though they're both correct:
#EXAMPLE 1 function start() ( // code goes here ) #EXAMPLE 2 function turnColourBlack() { $this->colour = "Black"; } The 1st example is wrong, come on. It's no wonder there are so many forum posts about the articles you write, because nobody can understand them. One word: editor :] -Feti Chico p.s. If you'd like to know where I got the incorrect example, here is the URL: http://www.devshed.com/Server_Side/PHP/BackToClass/page6.html |
|
#30
|
|||
|
|||
|
Re: Do I really need class?
One of the most important uses of classes is the ease of compatitbility when two or more people are writing code together. Modular programming can be very beneficial to have a class where the interface is separated from the implementation and allows people to add on to your code very easily. However, since it seems that most PHP programming is done on more of a personal basis, there probably is not as much code sharing going on as there would be in a more comercial program being written in C++.
|
![]() |
| Viewing: Dev Shed Forums > Other > Development Articles > Back To Class |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|