-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate-hooks.php
More file actions
40 lines (37 loc) · 1004 Bytes
/
template-hooks.php
File metadata and controls
40 lines (37 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/************************************************************
* Register theme hooks
************************************************************/
/**
* Example hook declaration. This instructs Drupal to look
* for the example hook function or theme when rendering
* site content via its theme layer.
*/
function CUSTOM_theme()
{
return array(
'example' => array(
'variables' => array(
array(
'foo' => 'bar'
)
)
)
);
}
/************************************************************
* Implement theme hooks
************************************************************/
/**
* Example hook implementation
*
* <?php
* echo theme('example', array('foo' => '123'));
*
* This may also be a template `example.tpl.php`. Use template
* files if the generated HTML markup is non-trivial.
*/
function CUSTOM_example(&$variables)
{
return '<div>' . $variables['foo'] . '</div>';
}