Pixel & Tonic

FieldFrame

version works on rated
1.4 EE1
Download Get Help

Defining Your Fieldtype’s Requirements

FieldFrame 0.9.2 and later allows you to define your fieldtype’s requirements. You do this by creating a new class variable called $requires:

class Checkbox_group extends Fieldframe_Fieldtype {

    // ...

    var $requires = array(
        'ff' => '1.3.5',
        'cp_jquery' => '1.1',
        'ext' => array(
            array('class'   => 'Gypsy',
                'version' => '1.0.0',
                'name'    => 'Gypsy',
                'url'     => 'http://brandon-kelly.com/apps/gypsy'
            )
        )
    );

    // ...

}

Here are the $requires array keys FieldFrame will check for:

php
PHP version
ee
ExpressionEngine version
ee_build
ExpressionEngine build date (ex: 20090211)
ff
FieldFrame version
cp_jquery
CP jQuery extension version
ext
(array) — info about any other required extensions. Each element is an array with the following keys:
class
the extension’s class name
version
the extension’s required version
name
the extension’s name
url
the URL to the extension

Each version specified is treated as a minimum required version. As long as the user has that version or later installed (and activated, if it’s an extension), FieldFrame won’t complain.

If the environment does not meet your defined requirements, FieldFrame will ignore your fieldtype, and a notice will appear beneath it in the Fieldtypes Manager, listing out each unmet requirement.