Joomla method for registering users to add new fields _ php instance

Source: Internet
Author: User
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);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.