Recipe 76: Understanding how Theme functions are called
As our theme_pager
function demonstrates, it is not unusual to find themeable functions calling other themeable functions. Being able to detect these building blocks is a good step toward deeper Drupal understanding.
Themeable functions are called by modules and themes using the theme()
function. Some examples will be helpful:
General Example
theme_function_name
is called using the following syntax:
theme('function_name', parameter, parameter…)
Specific Example #1
Visit http://api.freestylesystems.co.uk/api/function/theme_views_view/5
This is an excerpt of the
views.module
, containing the theme_views_view function. Each time a view is built this function is run.Locate the spot in the code where the theme_view_more function is called.
theme('views_more', $view->real_url);
(In the full code, the function result is assigned to the
$output
variable.)Make note of the surrounding "
if
statement" controlling the theme_views_more output.if ...