Pixel & Tonic

FieldFrame

version works on rated
1.4 EE1
Download Get Help

Anatomy of a Fieldtype

Before you create a fieldtype extension, you first must think of a class name. The class name should be based on the fieldtype’s name, and it must be unique. A common practice to ensure that a class name is unique is to tag it with your initials or company name.

Once you’ve thought of a class name, create a new folder in your fieldtypes folder, and name it your class name (all lowercase). Inside it, create a new file called ft.my_class_name.php. This file will contain your main fieldtype extension class.

Use the class in A simple fieldtype as a starting point for this file. Remember that when you define your class, it must be named identically to the containing folder’s name and the mid section of the file name. The only exception is that the very first letter must be capitalized.