|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
yet another good article.
yet another good article, bravo sizlere!
id |
|
#2
|
|||
|
|||
|
Re: yet another good article.
Yea, I read the article, and it really seems to pull object oriented programming down from the ivory tower to something us mere mortals can use. Seems very clear. Can't wait to try it. Keep up the good work! Thanks.
|
|
#3
|
|||
|
|||
|
Errata
Well, I'm a web developer that uses classes extensevely at work, and I was reading the article when I found a big mistake:
Class whatever { function foo() { } } There are parenthesis on the functions for the classes, instead of braces. Now, usually this would not be a big deal, but since this article is aimed at newcomers on PHP and OOP in PHP, this can be a problem for newbies. |
|
#4
|
|||
|
|||
|
Re: Errata
Huh?
class whatever { function foo() { // function code } }// end class Is correct. It HAS to have BOTH parenthesis and braces not braces INSTEAD of parenthesis. |
|
#5
|
|||
|
|||
|
OO concepts
This is a nice article on the use of PHP or general Object oriented classes. It would help a novice to an expert programmer to create reusable robust code.
|
|
#6
|
|||
|
|||
|
Great job guys, keep up the good work!!!
Hi, just wanted to let you know i-ve been reading articles from devshed since 1998, and i think it-s the best tutorial site i-ve ever found.
This article is just perfect for non-guru guys (like me) trying to understand OOP and classes. Thanx. |
|
#7
|
|||
|
|||
|
Table example not applicable
Well, the example of a <b>table class</b> is pretty good. But it has nothing to do with real table task, or not finished (seems to me as newbe): how would I supply the real data into the table - as <b>flexible</b> as the table class itself?
|
|
#8
|
|||
|
|||
|
Re: Errata
The code on the board is correct the syntax for functions within a class in the article are wrong.
|
|
#9
|
|||
|
|||
|
Do I really need class?
The explanation of a situation where class is preferred (several objects) is not convincing.
<br> Let's assume, I have several shopping carts. <br> Every cart with its own functions? Where functions are <b>the same</b>? <br> It can be made as well with an array of cart variables and one set of functions for all carts. <br> <p> <br> The modularity of code is also not a reason: the above mentioned array and functions can be included as separate file as well. <br> <p>There is something more important with classes, what is unfortunately not mentioned here. <br> |
|
#10
|
|||
|
|||
|
Re: Errata
Ah, you are right. I was going by what jpm wrote and didn't look at the article.
|
|
#11
|
|||
|
|||
|
code share
more than reusing in the net???? its great that ideas could be seen and more style could be heard......
code well i guess classes are good /code |
|
#12
|
|||
|
|||
|
agreed.
Devshed sure has picken up the pace lately, great job guys! You make us happy.
|
|
#13
|
|||
|
|||
|
error in extending
IN the extension example, the draw table function uses cell spacing which is not defined in the original class but in the extended class only. The drawTable() function should be part of extended class not the original one. The drawTable() in the original should not use cell_spacing.
|
|
#14
|
|||
|
|||
|
Re: Errata Corrections
Hello!
You're absolutely correct - the function code should be included within curly braces, not regular parentheses. I don't know how I missed that error when writing the article. Thank you for pointing the oversight out, and apologies to everyone who was affected by it. A corrected version will be posted shortly. icarus, Melonfire |
|
#15
|
|||
|
|||
|
.php4??? NOoooo!!!
Please do *NOT* use the .php4 extension. It's bad practice, and a support nightmare. it should be .php, plain and simple. (there is a reason it comes that way in your httpd.conf!)
Mike |
![]() |
| Viewing: Dev Shed Forums > Other > Development Articles > Back To Class |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|