PHP 把课程放在身体周围

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 把课程放在身体周围相关的知识,希望对你有一定的参考价值。

/**
 * Make additional variables available and override some core variables
 */
function _phptemplate_variables($hook, $vars) {
  switch ($hook) {
    case 'page': 
      $vars['page_class'] = (($vars['is_front']) ? 'front' : _MyTheme_css_safe(arg(0)) );

      if (in_array($vars['page_class'], _MyTheme_list_top_level_classes())) {
        $vars['has_menu_image'] = TRUE;
      }
    break;
   }

  return $vars;
}

/**
 * Prepare the specified string for use as a CSS identifier.
 */
function _MyTheme_css_safe($string, $length = 36) {
  // Replace or drop apostrophes based on user settings
  $separator = '-';

  // Preserve alphanumerics, everything else becomes a separator
  $pattern = '/[^a-zA-Z0-9]+/ ';
  $output = preg_replace($pattern, $separator, $string);

  // Trim any leading or trailing separators (note the need to
  // escape the separator if and only if it is not alphanumeric)
  if ($separator) {
    if (ctype_alnum($separator)) {
      $seppattern = $separator;
    }
    else {
      $seppattern = '\\'. $separator;
    }
    $output = preg_replace("/^$seppattern+|$seppattern+$/", "", $output);
  }

  // Enforce the maximum component length
  $output = drupal_substr($output, 0, $length);

  return $output;
}

/**
 * List with toplevel classes
 * @TODO: you probably want to make this configurable somewhere;
 **/
function _MyTheme_list_top_level_classes() {
  $list = array(
    'node',
    'taxonomy',
    'user',
    'profile',
  );
  return $list;
}

/**
 * The following takes place in page.tpl.php between 11PM and 12PM;
 **/
<?php
//....
<body class="<?php print $page_class ?>">
//....
    <?php if (!$is_front && $has_menu_image): ?>
       <h2 class="content title" id="content-title-image"><?php print $title ?></h2>
    <?php endif; ?>

以上是关于PHP 把课程放在身体周围的主要内容,如果未能解决你的问题,请参考以下文章

C语言课程设计,贪吃蛇应该怎么做?

html CrazyEgg Script - 放在关闭身体标签上方

libgdx - 检查身体是否接触

通过示例学习rholang(下部:课程8-13)

你认为我应该把我所有的 php 函数放在一个文件中吗?

我应该把我的 php 文件放在哪里让 Xampp 解析它们?