沃梦达 / 编程问答 / php问题 / 正文

在默认 joomla 3.1.1 注册表单中添加自定义字段

Adding custom field in default joomla 3.1.1 registration form(在默认 joomla 3.1.1 注册表单中添加自定义字段)

本文介绍了在默认 joomla 3.1.1 注册表单中添加自定义字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我在 Joomla 3.1.1 中偶然发现了一种情况,我需要添加一个附带默认注册表单的自定义字段.

Recently I have stumbled upon a situation in Joomla 3.1.1 where I need to add a custom field attached with default registration form.

我浏览了现有资源,这些资源说我应该导航到joomla_root/components/com_users/models/forms/registration.xml,然后相应地更改文件.

I surfed the existing resources which say that I should navigate to joomla_root/components/com_users/models/forms/registration.xml and then change the file accordingly.

我已经这样做了,但没有任何显示.我还需要更改模型和控制器中的 registration.php.所以,我需要你的意见如何做到这一点.我无法使用配置文件插件或商业扩展.

I have done that but nothing is showing up. I also need to change registration.php in model and controller too. So, I need your inputs on how to do that. I can't use profile plugin or commercial extensions.

    One more thing that I've noticed is the fact that changing registration.xml file and such things work perfectly fine in Joomla 2.5 but isn't working in 3.x.

推荐答案

最后发现问题出在一个叫K2的组件.我在joomla 2.5里试过这个自定义注册的东西然后突然想到禁用 K2 系统插件怎么样..它起作用了.

Eventually it turns out that the problem was a component called K2.I tried this custom registration stuff in joomla 2.5 and then suddenly thought how about disabling K2 System Plugin..It worked.

我发布了这样做的步骤:

Im posting the steps to do so:

1.导航到 joomla_root/components/com_users/models/forms/registration.xml 并在那里添加一个字段.

1.Navigate to joomla_root/components/com_users/models/forms/registration.xml and add a field there.

2.然后打开 joomla_root/components/com_users/models/registration.php 然后在函数 register() 中更改您的自定义字段.

2.Then open up joomla_root/components/com_users/models/registration.php and then in the function register() change ur custom fields.

3.不要忘记在你的数据库表#_users中添加一个你在registration.xml中添加的字段

3.Don't forget to add a field in ur database table #_users which you have added in registration.xml

这篇关于在默认 joomla 3.1.1 注册表单中添加自定义字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:在默认 joomla 3.1.1 注册表单中添加自定义字段

基础教程推荐