You are viewing documentation for v1.1.x. Change

table()

Description

Use this method to tell Wheels what database table to connect to for this model. You only need to use this method when your table naming does not follow the standard Wheels convention of a singular object name mapping to a plural table name.

Function Syntax

table(name)

Parameters

Parameter Type Required Default Description
name string Yes Name of the table to map this model to.

Examples

<!--- In models/User.cfc --->
<cffunction name="init">
    <!--- Tell Wheels to use the `tbl_USERS` table in the database for the `user` model instead of the default (which would be `users`) --->
    <cfset table("tbl_USERS")>
</cffunction>