CakeDC用户插件-如何在注册表单中添加详细信息字段(即-first_name,company) [英] CakeDC users plugin - how to add details field(i.e - first_name, company) in to registration form

查看:61
本文介绍了CakeDC用户插件-如何在注册表单中添加详细信息字段(即-first_name,company)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了cakeDC Users插件,并按照自述文件中的说明扩展/覆盖了用户控制器和模型。

I have installed the cakeDC Users plugin and extend/override users controller and model as they described in to the Readme. Seems everything working.

但是,我想修改注册表单和插件以添加字段-first_name,company等,并允许管理员用户激活用户帐户。

But, I want to modify the registration form and plugin to add fields - first_name, company etc. and enable user account activation by admin user.

所以,我的问题是,我怎么

So, my question is, how do I


  • 将自定义字段添加到注册表格

  • 禁用电子邮件验证

  • 默认情况下禁用激活用户帐户

我是CakePHP的新手,并且关于CakeDC的文档也很少。

I am new to cakePHP and there is not so much documentation for cakeDC as well.

有人可以帮忙吗?

推荐答案

我不会在这里完成您的工作并为您编写所有代码,但让我给您几个方向:

I'm not going to do your work here and writing all the code for you but let me give you a few directions:

1)只需将注册视图复制到/app/View/Plugin/Users/register.ctp(或任何称为View文件的文件)中按照UserDetail字段的相同模式在此处添加字段。用户详细信息只是键值存储。并且已经被删除了,因为人们通常偏爱专用配置文件表或类似的东西,而不是键值存储难以使用。

1) Just copy the register view to /app/View/Plugin/Users/register.ctp (or whatever the view file is called) and add the field there following the same pattern for the UserDetail fields. The user details are just a key value store. And were also already removed in the develop branch because peoply usually favor a dedicate profiles table or something similar over the hard to work with key-value store.

2)您是否甚至花了5分钟时间看代码?扩展UsersController并重载该方法,并将参数更改为false或重载整个电子邮件发送方法,根本就不添加任何代码。

2) Did you even spent 5 minutes looking at the code? Extend the UsersController and overload the method and change either the argument to false or overload the whole email sending method and simply don't add any code to it.

3)简单再次OOP-扩展类,重载方法,更改代码的行为。

3) Simple OOP again - extend the class, overload the method, alter the behaviour of the code.

另一种解决方案是简单地分叉插件并直接更改代码并保留更改在单独的分支中,您可以使用插件起源存储库中的更改进行更新。

Another solution is to simply fork the plugin and alter the code directly and keep your changes in a separate branch you can update with the changes from the plugins origin repo.

或者,您可以简单地聘请CakeDC对其进行集成。 ;)

Alternatively you could simply hire the CakeDC to integrate it. ;)

这篇关于CakeDC用户插件-如何在注册表单中添加详细信息字段(即-first_name,company)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆