You are here: Re: When to make a class « PHP « IT news, forums, messages
Re: When to make a class

Posted by "Matt Monaco" on 11/26/05 18:38

There's really no reason making classes for those (unless you'd like to
write an entire HTML class and its children - I'd be happy to use it!).

Matt

"Todd Cary" <todd@aristesoftware.com> wrote in message
news:DB.E6.56276.13688834@pb1.pair.com...
> My background is in Object Oriented Pascal (Delphi), however I am having
> difficulty knowing when to make a class in PHP. For instance, in my
> script file, functions.php, I have these functions among others:
>
> /* Input a field */
> function input_field($name, $value, $size, $max) {
> echo('<INPUT TYPE="text" NAME="' . $name . '" VALUE="' . $value .
> '" SIZE="' . $size . '" MAXLENGTH="' . $max . '">');
> };
>
> /* Input a password field */
> function input_password_field($name, $value, $size, $max) {
> echo('<INPUT TYPE="password" NAME="' . $name . '" VALUE="' . $value .
> '" SIZE="' . $size . '" MAXLENGTH="' . $max . '">');
> };
>
>
> Should I have a class that contains these functions (methods)?
>
> One of my non-profit clients would like to have an online emailer program
> driven by a MySQL database. This I can envision as a class, actually
> several classes (e.g. send mail, create message, select addresses, etc.).
>
> Todd

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация