Community Documentation

Example: How to Grab Arguments For a View From It's Header or Footer

Last updated December 20, 2011. Created by merlinofchaos on December 29, 2005.
Edited by diwant, linclark, joshmiller, Albert Volkman. Log in to edit this page.

If you want to grab the arguments of a view using PHP in Drupal 6.x or 7.x use the following:

<?php
// Let's get the current view
$view = views_get_current_view();
// Now we can get the views arguments
print $view->args;
?>

This way, you can grab the arguments for use in the Header or Footer of the view.

Page status

Needs technical review

Log in to edit this page

About this page

Drupal version
Drupal 6.x, Drupal 7.x
Audience
Developers and coders
Level
Intermediate
Keywords
Views

Tutorials and site recipes

Drupal’s online documentation is © 2000-2012 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.