Jump to content

calcop

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

calcop's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What I am trying to do is make a class that automates text boxes for forms. Does all the error checking, validation, etc. I need the class to automaticly populate the updated infromation from $_GET or $_POST. So, I need the class to know what its own variable name is, so I could use it for the names of the text boxes. I did think about passing it to the constructor, but that would open a big door to errors (human errors). I decided to make an automated key for each textbox name. So far it is working good. After spending a lot of time resarching, I don't think there is a way that you can have your class lookup which variable it exists in. Thanks for your help!
  2. Think though your reply, before you reply. It was just sample code. I "as the scripter" know what the class name is. I need the class to be able to know what variable it is existing in.
  3. Why even use a form? You don't have any input objects within your form.
  4. Hello everyone! I was hoping someone could help me with my problem. I have been reading over the PHP manual, but cannot find the answer to my question. I need to get the variable name of a declared class. For example, I need to be able to do something such as: [code] $MyNewClassObject = new SideBar; $MyNewClassObject->getVarName (); [/code] getVarName should return "MyNewClassObject"; I thought I had found the answer with [!--coloro:#33CC00--][span style=\"color:#33CC00\"][!--/coloro--]__CLASS__[!--colorc--][/span][!--/colorc--] and [!--coloro:#000099--][span style=\"color:#000099\"][!--/coloro--]get_class()[!--colorc--][/span][!--/colorc--], but that only returns the class name, not the variable it is declared under. Thanks for your help! -Matt
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.