This article describes how to add a new field to a registered user in joomla. The example shows how to add a new field to a registered user in Joomla and related implementation skills, for more information about how to add a new field to a registered user, see the example in this article. We will share this with you for your reference. The details are as follows:
The original registration of joomla is very simple. to add the desired field, such as the phone number.
Add this field "telphone" to the database"
Modify libraries \ joomla \ database \ table \ user. php
Add a new variable in the JTableUser class:
var $telphone = null;
Page modification
Modify components \ com_user \ views \ register \ tmpl \ default. php
Add the input field here. the name must be the same as the field defined by your database.
The code is as follows:
After all, it is not good to directly modify the source code. Therefore, we recommend that you modify the page code of the component in your own templates folder to minimize the modification of the source code.
Finally, you do not want to send an email to the user. the new user can only take effect after being reviewed by the background Administrator. comment out the following code components \ com_user \ controller. php:
//UserController::_sendMail($user, $password);