Built-in Convenience Functions
By extending the Fieldframe_Fieldtype class, your fieldtype’s class inherits several convenience functions. You can call them from within any of your class functions.
function display_field($field_name, $field_data, $field_settings)
$this->include_js('scripts/ff_checkbox.js');
$this->include_css('styles/ff_checkbox.css');
// ...
}
Functions at a Glance
get_last_call()include_js()include_css()insert_js()insert_css()prep_iterators()parse_iterators()
get_last_call()
Use this to get the last-returned value for an extension hook. (See Extension Hooks)
Arguments
$default- (mixed) — The default value, if no last call value is found
include_js()
Include a javascript file
Arguments
$path- (string) — The path to your javascript file (relative to your fieldtype’s main folder)
include_css()
Include a CSS file
Arguments
$path- (string) — The path to your CSS file (relative to your fieldtype’s main folder)
insert_js()
Insert javascript code directly into the page
Arguments
$js- (string) — The javascript code to be inserted into the page
insert_css()
Insert CSS styles directly into the page
Arguments
$css- (string) — The CSS styles to be inserted into the page
prep_iterators()
Prepares template markup for {count} and {switch} variable parsing. Called before the loop.
Arguments
&$tagdata- (string) — The tagdata potentially containing
{count}and{switch}tags
parse_iterators()
Parse {count} and {switch} tags in template markup. Called within the loop.
Arguments
&$tagdata- (string) — The tagdata potentially containing
{count}and{switch}tags