Views Documentatio n
- Views 1.x user documentatio
n - Inserting Views
- Theming your Views
- Views 1.x module developer API
- Tables part 1: Joins
- Tables part 2: Handlers and Option fields
- Tables part 3: Fields
- Tables part 4: Sort criteria
- Tables part 5: Filters
- Arguments
- Default views
- Other hooks
- The $query object
- The $view object
- Functions exposed by Views
- Creating views programmatic
ally - Example: node_example.module
- How to run your own query through Views 1.x
- Style plugins
- Advanced: Dealing with 'multipl
e' fields and Views - Advanced: Using views_build_
view to control your own views - Troubleshoo
ting: Common problems
- Views 2.x module developer API
- Views Fusion
- Views Tutorials
- Why use Views? Why not write your own queries?
Handbook license
The Drupal handbook pages are © 2000-2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- ShareAlike 2.0 PHP code is distributed under the GNU General Public License
User login
Contributor links
- Advanced search
- Queues
- Patch spotlight
- Play patch bingo!
- Play bug bingo!
- Mailing list archives
- Drupal.org webmasters
- Drupal.org server administrato
rs - Web links

A quick overview
For my own edification, I created a dummy View Type to print out the contents of the $view object with the following code:
<?php
/**
* Implementation of hook_views_style_plugins()
* Adds a callback entry to the Page/Block 'View Type' dropdowns
*/
function example_views_style_plugins() {
$styles = array();
$styles['example'] = array(
'name' => 'Example',
'theme' => 'example_view',
'validate' => 'views_ui_plugin_validate_list',
'needs_fields' => true,
// 'weight' => 10,
);
return $styles;
}
/**
* Theme callback for example_views_style_plugins()
*/
function theme_example_view($view, $nodes, $type) {
return print_r($view);
}
?>
Basically, it looks like this:
stdClass Object ([vid] => 1
[name] => Example View
[description] => This is an example view
... The first 30 or so key-value pairs are pulled directly from the "view_view" table.
... Take a look at table definition in phpMyAdmin or the like for more detail.
...
[sort] => Array (
[0] => Array (
[vid] => 1
... Likewise, each of these keyed arrays corresponds to records in the "view_sort" table,
... with the addition of the following 'id' key:
...
[id] => node_data_field_examplefield.field_examplefield_value
)
)
[argument] => Array ( Array (
[0] => Array (
[vid] => 1
... Key-value pairs pulled from the "view_argument" table
...
)
)
[field] => Array (
[0] => Array (
[vid] => 1
... Key-value pairs pulled from the "view_tablefield" table,
... with the addition of the following three fields added programatically:
...
[fullname] => node_data_field_examplefield.field_examplefield_fid
[id] => node_data_field_examplefield.field_examplefield_fid
[queryname] => node_data_field_examplefield_field_examplefield_fid
)
)
[filter] => Array (
... Records from "view_filter"
)
[exposed_filter] => Array (
... Records from "view_exposed_filter"
)
);
So it seems as if the $views object is really just there to link these tables together and leaves the heavy lifting of actually getting the records' values to the various "_views_get_xxx" functions contained in views_cache.inc.