Pass block configuration item text field value to variable

by lcunning   Last Updated January 10, 2018 21:07 PM

I have a custom block module that has a configuration form of type text_field. If there is a value entered into the configuration form, I want to store that value in a variable.

Here is the configuration hook:

/**
 * Implements hook_block_configure().
 */
function roadmap_block_configure($delta = 'roadmap') {
  // This example comes from node.module.
  $form = array();

  switch($delta) {
    case 'roadmap' :
      $form['roadmap_configuration_form'] = array(
      '#type' => 'text_format',
      '#title' => t('Enter an alternative URL.'),
// the URL entered will be sanitized and attached to hook_block_view(), and ultimately passed to a custom JavaScript file.
    );
    break;
  }
  return $form;
}

If there is a value entered into the configuration form, how can I store it in a variable?



Related Questions


Pass a variable from a node to a block module

Updated January 08, 2018 23:07 PM

Form does not save value to variable

Updated July 03, 2015 18:03 PM

File Upload form issue

Updated September 12, 2016 08:05 AM

Saving values using variable_set through an array

Updated March 14, 2016 08:03 AM