block_example_contents
developer/examples/block_example.module, строка 77
- Версии
- 5 – 6
block_example_contents($which_block)
Функция определяющая содержимое блока.
Код
<?php
function block_example_contents($which_block) {
if ($which_block == 1) {
// Modules would typically perform some database queries to fetch the
// content for their blocks. Here, we'll just use the variable set in the
// block configuration or, if none has set, a default value.
return variable_get('block_example_string', t('A default value.'));
}
if ($which_block == 2) {
// It is possible that your block will not have any content, since it is
// probably dynamically constructed. In this case, Drupal will not display
// the block at all.
return;
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии