You are here

function conditional_fields_example_fancy_view_behavior in Conditional Fields 7.3

Example view behavior callback.

Parameters

$dependent: The name of the dependee field.

$dependee: The name of the dependent field.

$is_triggered: A boolean indicating whether the dependency was triggered.

$dependencies: An array of dependencies relevant to this context.

$build: The entity that is being viewed.

$entity_type: The entity type that is being viewed.

File

./conditional_fields.api.php, line 190
Hooks provided by Conditional Fields.

Code

function conditional_fields_example_fancy_view_behavior($dependee, $dependent, $is_triggered, $dependencies, &$build, $entity_type) {

  // Add some foo before all entities that have triggered dependencies.
  if ($is_triggered) {
    $build['#prefix'] .= 'foo';
  }
}