I m New to CFWheels and framework in general.
I m following the screencasts on the Wheels website: http://cfwheels.org/screencasts/
我的座右铭与......唯一的区别是,他的桌子被称作“人民”,地雷被称为“使用者”。 因此,我做了改动,但一切照旧。
他的单体是“人”,地雷是“用户”。
这里的“User.cfc”控制器插入代码:
<cfcomponent extends="Controller" output="true">
<cffunction name="register">
<cfset user = model("user").new() />
</cffunction>
<cffunction name="create">
<cfset params.user[ userUUID ] = createUUID() />
<cfset params.user[ userCreated ] = createODBCDateTime(now()) />
<cfset params.user[ userModified ] = createODBCDateTime(now()) />
<cfset user = model("user").new(params.user) />
<cfset user.save() />
</cffunction>
</cfcomponent>
Now, I m also using the form helpers etc in my view like so:
<cfparam name="user" />
<cfoutput>
#startFormTag( action="create" )#
<fieldset>
<legend>Register</legend>
#textField( label="User Name http://#cgi.server_name#/user/", objectName="user", property="userName" )#
#textField( label="Email Address", objectName="user", property="userEmail" )#
#textField( label="Password", objectName="user", property="userPassword" )#
#submitTag( value="Register" )#
</fieldset>
#endFormTag()#
</cfoutput>
Pretty simple right? So I can t understand why it isn t inserting. Does it have something to do with naming my CFC "user" and also having a table called "users" with my singular name set as "user"?
当我提交表格时,没有错误。 它只执行罚款,但是如果我看在非行,就没有。
One thing I thought...is...exactly HOW does wheels even know what Table to look for? There doesn t seem to be any explanation for this. Perhaps it just locates the wrong table?
Many thanks, Michael
缩略语
每个人,只能向可能进入这一阶段的其他人提供最新情况。 之所以没有发生,是因为我的数据库表REQUIRED某些领域没有取消。 CFWheels被推倒任何错误。 一旦我把这些价值观传给这些领域,那是很不错的。
希望会有所帮助。