You are here

class dsFieldFunction in Display Suite 6.3

The function field type

Hierarchy

Expanded class hierarchy of dsFieldFunction

1 string reference to 'dsFieldFunction'
function.inc in plugins/ds_field/function.inc

File

plugins/ds_field/function.inc, line 17

View source
class dsFieldFunction extends dsField {

  /**
   * Format content for use in an item
   */
  public function formatContent() {
    $content = NULL;
    if (isset($this->settings['function'])) {

      // Load includes
      if (isset($this->settings['file'])) {
        include_once $this->settings['file'];
      }

      // If its a function, call it
      if (isset($this->settings['function']) && !empty($this->settings['function'])) {
        if (function_exists($this->settings['function'])) {
          $this->content = call_user_func($this->settings['function'], $this->settings);
          return $this->content;
        }
      }
    }
    return FALSE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
dsField::$attributes protected property Field attributes
dsField::$content public property Content for the field
dsField::$key public property Field key
dsField::$settings public property Field settings
dsField::build function Build an individual field value
dsField::defaults protected function Return default values for a field
dsField::getContent function Get content for use in a field.
dsField::initialise public function Initialise field defaults
dsField::render public function Return a value for a field or group 1
dsField::setting public function Wrapper to set a value on a field
dsFieldFunction::formatContent public function Format content for use in an item Overrides dsField::formatContent