zoukankan      html  css  js  c++  java
  • Drupal 主题的表现形式

    1、template.php

    /**
     * Implements hook_theme().
     */
    function yourtheme_theme($existing, $type, $theme, $path) {
      $base = array(
        'render element' => 'form',
        'path' => drupal_get_path('theme', 'yourtheme') . '/templates/forms',
      );
      return array(
        'commerce_checkout_form_checkout' => $base + array(
          'template' => 'commerce-checkout-form-checkout',
        ),
      );
    }
    /**
     * Preprocessor for commerce_checkout_form_checkout theme.
     */
    function yourtheme_preprocess_commerce_checkout_form_checkout(&$variables) {
      /* Add or modify your variables */
    }

    2、/templates/forms/commerce-checkout-form-checkout.tpl.php

    // Render or hide parts of $form: var_export($form);
    // Example given:
    hide($form['title']);
    print render($form['first']);
    // Render remaining form elements as usual.
    print drupal_render_children($form);
  • 相关阅读:
    《梦段代码》阅读笔记03
    用户场景
    冲刺!
    冲刺!
    周总结8
    冲刺!
    冲刺!
    PMS权限管理和鉴权过程
    PMS构造函数以及apk如何扫描
    PMS的学习之旅
  • 原文地址:https://www.cnblogs.com/wzzkaifa/p/7225689.html
Copyright © 2011-2022 走看看