function hook_views_api in Views (for Drupal 7) 6.3
Same name and namespace in other branches
- 6.2 docs/docs.php \hook_views_api()
- 7.3 views.api.php \hook_views_api()
Register View API information. This is required for your module to have its include files loaded; for example, when implementing hook_views_default_views().
Return value
An array with the following possible keys:
- api: (required) The version of the Views API the module implements.
- path: (optional) If includes are stored somewhere other than within the root module directory or a subdirectory called includes, specify its path here.
- template path: (optional) A path where the module has stored it's views template files. When you have specificed this key views automatically uses the template files for the views. You can use the same naming conventions like for normal views template files.
Related topics
1 function implements hook_views_api()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- views_views_api in includes/
handlers.inc - Implementation of hook_views_api().
1 invocation of hook_views_api()
- views_get_module_apis in ./
views.module - Get a list of modules that support the current views API.
File
- docs/
docs.php, line 286 - This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.
Code
function hook_views_api() {
return array(
'api' => 2,
'path' => drupal_get_path('module', 'example') . '/includes/views',
'template path' => drupal_get_path('module', 'example') . 'themes',
);
}