Professional Documents
Culture Documents
Views Handlers & Plugins
Views Handlers & Plugins
Views handlers
Handler registration
Handlers are stored in their own files and loaded on demand. Like all other module files, they must first be registered through the module's info file.
Handler registration
Put this in your module.info files[] = includes/views/handlers/example_handler_argument_string.inc
Handler flows
Handlers have two distinct code flows: - the UI flow - the view building flow
- handler->set_definition()
- Set the data from hook_views_data() relevant to the handler.
- handler->init()
- Attach the handler to a view, and usually provides the options from the display.
- handler->pre_query()
- Run prior to the query() stage to do early processing.
- handler->render()
- This does the actual work of rendering the field.
hook_views_data()
Views plugins
In Views, a plugin is a bit like a handler, but plugins are not directly responsible for building the query. Instead, they are objects that are used to display the view or make other modifications.
hook_views_plugins()
Here is an example of a row style plugin from Views core:
Pager plugin
Plugin type: pager
THANK YOU
QUESTIONS ?