php_filter

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/php/php.module, строка 71

Версии
6
php_filter($op, $delta = 0, $format = -1, $text = '')

Implementation of hook_filter(). Contains a basic PHP evaluator.

Executes PHP code. Use with care.

Код

<?php
function php_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(0 => t('PHP evaluator'));
    case 'no cache':
      // No caching for the PHP evaluator.
      return $delta == 0;
    case 'description':
      return t('Executes a piece of PHP code. The usage of this filter should be restricted to administrators only!');
    case 'process':
      return drupal_eval($text);
    default:
      return $text;
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему