function _views_create_handler in Views (for Drupal 7) 6.2
Same name and namespace in other branches
- 6.3 includes/handlers.inc \_views_create_handler()
- 7.3 includes/handlers.inc \_views_create_handler()
Instantiate and construct a new handler
3 calls to _views_create_handler()
- views_get_handler in ./
views.module - Fetch a handler from the data cache.
- views_get_plugin in ./
views.module - Get a handler for a plugin
- _views_prepare_handler in includes/
handlers.inc - Prepare a handler's data by checking defaults and such.
File
- includes/
handlers.inc, line 10 - handlers.inc Defines the various handler objects to help build and display views.
Code
function _views_create_handler($definition, $type = 'handler') {
// vpr('Instantiating handler ' . $definition['handler']);
if (empty($definition['handler'])) {
return;
}
if (!class_exists($definition['handler']) && !views_include_handler($definition, $type)) {
return;
}
$handler = new $definition['handler']();
$handler
->set_definition($definition);
// let the handler have something like a constructor.
$handler
->construct();
return $handler;
}