Jump to content
Killersites Forums

Why $template->getData() instead of $this->getData()?


Recommended Posts

I'm on the PHP Logic with OOP section, and have what I think may be a pretty simple question.

In v_login.php, where I see the login form, line 27 for example has this code:

<input type="password" name="password" value="<?php echo $this->getData('input_pass'); ?>"> - This line of code takes the user input, and spits it into the form for the user to see.

Then, in login.php, there is this code on line 30:

$_SESSION['username'] = $Template->getData('input_user'); - this line of code adds to the $_SESSION variable.

As v_login.php is included in login.php, why are there two different ways of calling the getData function?  Shouldn't there just be one way to call the function, given v_login.php is included in login.php?

Thanks,

Andrew

Edited by Drew2
Link to post
Share on other sites
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...