home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (phptemplate.engine)

This example Drupal source code file (phptemplate.engine) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

array, directory, drupal_find_theme_functions, drupal_root, existing, file, function, path, php, phptemplate_init, return, templates, theme, type

The phptemplate.engine Drupal example source code

// $Id: phptemplate.engine,v 1.75 2010/02/23 19:03:37 webchick Exp $

 * @file
 * Handles integration of PHP templates with the Drupal theme system.

 * Implements hook_init().
function phptemplate_init($template) {
  $file = dirname($template->filename) . '/template.php';
  if (file_exists($file)) {
    include_once DRUPAL_ROOT . '/' . $file;

 * Implements hook_theme().
function phptemplate_theme($existing, $type, $theme, $path) {
  $templates = drupal_find_theme_functions($existing, array($theme));
  $templates += drupal_find_theme_templates($existing, '.tpl.php', $path);
  return $templates;

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal phptemplate.engine source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.