Module CustomFields Dev: Difference between revisions

Jump to navigation Jump to search
Line 101: Line 101:
== CustomFields JSON API ==
== CustomFields JSON API ==


To continue...
=== Storing extra options ===
 
You can use the '''setExtra()''' method to set extra options of a custom field.
 
Eg:
<source lang="php">
$extra = new stdClass(); // instanciating an empty object
$extra->myproperty = 'Anything I want here'; // set a property/extra option like this
$extra->category->subcategory->prop = true; // we can set recursive properties, there's not any limit to own deep the hierarchy can be
 
require_once(dirname(__FILE__).'/../class/customfields.class.php');
$fieldid = 'mycustomfields'; // $fieldid can either be a column_name or an ordinal_position from information_schema.columns
$result = $customfields->setExtra($fieldid, $extra); // store the extra options inside the database
</source>


= Architecture =
= Architecture =
439

edits

Navigation menu