How to get a value from block configuration's form control? I'm new to drupal stackexchange and drupal too.

I have made an example module that creates a block called "example". I added a textfield form control to the "example" block's configuration page using the hook_block_configuration hook function. Now I'm trying to get the value from the block configuration's form control in my hook_block_view hook function.

Here is what I have so far:

function example_block_info() {

    $blocks = array();

    $blocks['example'] = array(
        'info' =&gt; t('example'),
    );

    return $blocks;

}// end function

function example_block_configuration($delta = '') {

    $form = array();

    switch($delta) {

        case 'example' :

        $form['text'] = array(
          '#type' =&gt; 'textfield',
          '#title' =&gt; t('Text'),
          '#default_value' =&gt; '',
          '#size' =&gt; 50,
          '#maxlength' =&gt; 100,
          '#required' =&gt; true,
        );

    }// end function

    return $form;

}// end function

function example_block_view($delta) {

    $block = array();

    switch($delta) {

        case 'example' :
            $block['content'] = get_block_content(),
            break;

    }// end switch

    return $block;


}// end function

function get_block_content() {

    return /* textfield form control value */

}// end function


I figured I have to use the hook_block_save hook function to get the value from the '$edit' argument and store it somehow, but I'm not show how, or if that's the correct way to go about it.

function example_block_save($delta = '', $edit = array()) {

    switch($delta) {

        case 'example' :

            $edit['text'];

            break;

    }// end switch

}// end function
What you need is completely covered in example module: block_example.module

Have a look at following hooks:


block_example_block_configure
block_example_block_save
block_example_block_view