Re: [PHP] When to make a class

2005-11-27 Thread Ahmed Saad
On 11/26/05, Todd Cary [EMAIL PROTECTED] wrote:
/* Input a field */
function input_field($name, $value, $size, $max) {
  echo('INPUT TYPE=text NAME=' . $name . ' VALUE=' . $value .
   ' SIZE=' . $size . ' MAXLENGTH=' . $max . '');
};


A bit away from your OO question, but IMHO, such function good in
terms of rapid coding but bad  if you ever get a graphic/web designer
to redo your designs 'cause he or she will be all (!!) at your php
code.

-ahmed


--


-ahmed


Re: [PHP] When to make a class

2005-11-27 Thread Ahmed Saad
On 11/27/05, Todd Cary [EMAIL PROTECTED] wrote:
  Ahmed -
  Been there!  What would you suggest?  My HTML looks like this if I use this

look at http://smarty.php.net

-ahmed


[PHP] When to make a class

2005-11-26 Thread Todd Cary
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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php