Okay, so that's the code. Now, let's take a look at some ways in which it can be used—this will help us get a good idea about how it all interacts with each other.
The following is the sequence of steps:
A user opens the
register
controller in their browser and is prompted to enter their first name, last name, and e-mail addressThe user submits the form and the form is posted to the
index()
register functionThe
register
controller saves the user's details to theusers
table and generates a password for themThis is sent to them in an e-mail and is sent to the email address submitted earlier
The user can then log back in to the system and amend their details as they wish