DB フィールド " tag"、" tag_url"、および " tag_weight" と、それらを入力するためのフォームを備えた小さなモジュールを作成しました。
カスタムブロックにDB値を出力したいのですが、正しい方法で作成する方法がわかりません:-/
    /**
     * Implements hook_block_info().
     *
     * This hook declares what blocks are provided by the module.
     */
    function myModule_block_info() {
        $blocks['example_uppercase'] = array(
            // info: The name of the block.
            'info' => t('Example: uppercase this please'),
            'status' => TRUE,
        );
        return $blocks;
    }
    /**
     * Implements hook_block_view().
     *
     * This hook generates the contents of the blocks themselves.
     */
    function myModule_block_view($delta = '') {
        //The $delta parameter tells us which block is being requested. 
        switch ($delta) {
            case 'example_uppercase':
                    //Select items from DB
                $result = db_select('myModule','ht')
                    ->fields('ht',array('tag','tag_url','tag_weight'))
                    ->execute();
                    **$block['content'] = foreach($result as $value) { echo $value->tag; }**
                break;
        }
        return $block;
    }
これをやろうとすると、次のようになります。
PHP 解析エラー: 構文エラー、予期しない T_FOREACH /.module の 49 行目
データベースの値をブロックに出力する方法は?