arg

Versions
5
arg($index)
6 – 7
arg($index = NULL, $path = NULL)

Return a component of the current Drupal path.

When viewing a page at the path "admin/content/types", for example, arg(0) would return "admin", arg(1) would return "content", and arg(2) would return "types".

Avoid use of this function where possible, as resulting code is hard to read. Instead, attempt to use named arguments in menu callback functions. See the explanation in menu.inc for how to construct callbacks that take arguments.

Parameters

$index The index of the component, where each component is separated by a '/' (forward-slash), and where the first component has an index of 0 (zero).

Return value

The component specified by $index, or NULL if the specified component was not found.

▾ 130 functions call arg()

aggregator_form_category_submit in core/modules/aggregator/aggregator.admin.inc
Process aggregator_form_category form submissions.
aggregator_form_feed_submit in core/modules/aggregator/aggregator.admin.inc
Process aggregator_form_feed form submissions.
aggregator_page_category in core/modules/aggregator/aggregator.pages.inc
Menu callback; displays all the items aggregated in a particular category.
aggregator_page_last in core/modules/aggregator/aggregator.pages.inc
Menu callback; displays the most recent items gathered from any feed.
aggregator_page_rss in core/modules/aggregator/aggregator.pages.inc
Menu callback; generate an RSS 0.92 feed of aggregator items or categories.
aggregator_page_source in core/modules/aggregator/aggregator.pages.inc
Menu callback; displays all the items captured from a particular feed.
backup_migrate_crud_ui_create in contrib/backup_migrate/includes/crud.inc
Page callback to create a new item.
backup_migrate_crud_ui_delete in contrib/backup_migrate/includes/crud.inc
Page callback to delete an item.
backup_migrate_crud_ui_edit in contrib/backup_migrate/includes/crud.inc
Page callback to edit an item.
backup_migrate_crud_ui_export in contrib/backup_migrate/includes/crud.inc
Export an item.
backup_migrate_crud_ui_list in contrib/backup_migrate/includes/crud.inc
Page callback to list all items.
backup_migrate_ui_manual_backup_advanced in contrib/backup_migrate/backup_migrate.module
The menu callback for advanced manual backups.
block_admin_display_form in core/modules/block/block.admin.inc
Generate main blocks administration form.
blog_link in core/modules/blog/blog.module
Implementation of hook_link().
calendarsignup_nodeapi in contrib/event/contrib/calendarsignup/calendarsignup.module
hook_nodeapi implementation
captcha_form_alter in contrib/captcha/captcha.module
Implementation of hook_form_alter().
color_form_alter in core/modules/color/color.module
Implementation of hook_form_alter().
color_scheme_form in core/modules/color/color.module
Form callback. Returns the configuration form.
comment_admin in core/modules/comment/comment.admin.inc
Menu callback; present an administrative comment listing.
comment_node_url in core/modules/comment/comment.module
A simple helper function.
comment_render in core/modules/comment/comment.module
Renders comment(s).
contemplate_edit_type in contrib/contemplate/contemplate.module
dblog_init in core/modules/dblog/dblog.module
devel_node_access_block in contrib/devel/devel_node_access.module
event_block in contrib/event/event.module
Provides the blocks that this module is capable of displaying.
event_extra_user_form_submit in contrib/event/event.module
Special submit handler for the user timezone form.
event_form_alter in contrib/event/event.module
Implementation of hook_form_alter
event_node_ical in contrib/event/event.module
Return an ical for a specific event
event_page in contrib/event/event.module
Displays a page containing event information. The page layout defaults to a graphical calendar.
fckeditor_admin_profile_form in contrib/fckeditor/fckeditor.admin.inc
Form builder for a normal profile
fckeditor_process_form in contrib/fckeditor/fckeditor.module
fckeditor_process_textarea in contrib/fckeditor/fckeditor.module
This function create the HTML objects required for the FCKeditor
filter_admin_delete in core/modules/filter/filter.admin.inc
Menu callback; confirm deletion of a format. See alsofilter_admin_delete_submit()
filter_tips_long in core/modules/filter/filter.pages.inc
Menu callback; show a page with long filter tips.
fivestar_block in contrib/fivestar/fivestar.module
forum_nodeapi in core/modules/forum/forum.module
Implementation of hook_nodeapi().
gmap_location_block in contrib/gmap/gmap_location.module
Draw block of location for current node.
gmap_location_user_point in contrib/gmap/gmap_location.module
AHAH callback for getting the contents of a user point popup.
googleanalytics_footer in contrib/google_analytics/googleanalytics.module
Implementation of hook_footer() to insert Javascript at the end of the page.
hook_ucga_display in contrib/ubercart/docs/hooks.php
Used to determine whether or not UC Google Analytics should add e-commerce tracking code to the bottom of the page.
i18nblocks_form_block_box_delete_alter in contrib/i18n/i18nblocks/i18nblocks.module
Implementation of hook_form_FORM_ID_alter().
i18ncontent_menu_alter in contrib/i18n/i18ncontent/i18ncontent.module
Implementation of hook_menu_alter().
i18ntaxonomy_db_rewrite_sql in contrib/i18n/i18ntaxonomy/i18ntaxonomy.module
Implementation of hook_db_rewrite_sql().
i18ntaxonomy_translation_term_form in contrib/i18n/i18ntaxonomy/i18ntaxonomy.admin.inc
Produces a vocabulary translation form.
i18n_selection_mode in contrib/i18n/i18n.module
Selection mode for content.
i18n_textfield_process in contrib/i18n/i18n.module
Process callback for textfield elements.
image_attach_block in contrib/image/contrib/image_attach/image_attach.module
Implementation of hook_block().
image_load in contrib/image/image.module
Implementation of hook_load().
img_assist_block in contrib/img_assist/img_assist.module
Implementation of hook_block().
img_assist_form_alter in contrib/img_assist/img_assist.module
Implementation of hook_form_alter().
img_assist_init in contrib/img_assist/img_assist.module
Implementation of hook_init().
img_assist_loader in contrib/img_assist/img_assist.module
Output main img_assist interface HTML.
img_assist_popup in contrib/img_assist/img_assist.module
img_assist_properties in contrib/img_assist/img_assist.module
Load the image properties pane.
img_assist_thumbs in contrib/img_assist/img_assist.module
Load the thumbnail display pane.
lightbox2_form_user_login_block_alter in contrib/lightbox2/lightbox2.module
Implementation of hook_form_alter().
lightbox2_preprocess_page in contrib/lightbox2/lightbox2.module
location_search_form_alter in contrib/location/contrib/location_search/location_search.module
logintoboggan_form_alter in contrib/logintoboggan/logintoboggan.module
Implementation of hook_form_alter()
menu_get_active_help in core/includes/menu.inc
Returns the help associated with the active menu item.
menu_get_item in core/includes/menu.inc
Get a router item.
menu_local_tasks in core/includes/menu.inc
Collects the local tasks (tabs) for a given level.
menu_set_active_trail in core/includes/menu.inc
Sets or gets the active trail (path to root menu root) of the current page.
nice_menus_form_alter in contrib/nice_menus/nice_menus.module
Implementation of hook_form_alter().
og_notifications_form_alter in contrib/og/modules/og_notifications/og_notifications.module
Implementation of hook_form_alter().
og_notifications_groups in contrib/og/modules/og_notifications/og_notifications.module
Options callback for subscription fields in hook_notifications. Returns a list of groups for the current user (presuming that this callback is only relevant in the "add subscriptions" page).
openid_user_add_submit in core/modules/openid/openid.pages.inc
page_title_get_title in contrib/page_title/page_title.module
Simple wrapper function to get the currently set title for a page
page_title_page_get_title in contrib/page_title/page_title.module
Determines what title should be sent to the page template.
panels_node_form in contrib/panels/panels_node/panels_node.module
Implementation of hook_form().
profile_block in core/modules/profile/profile.module
Implementation of hook_block().
profile_field_form in core/modules/profile/profile.admin.inc
Menu callback: Generate a form to add/edit a user profile field. See alsoprofile_field_form_validate()
site_map_block in contrib/site_map/site_map.module
Implementation of hook_block().
statistics_exit in core/modules/statistics/statistics.module
Implementation of hook_exit().
statistics_node_tracker in core/modules/statistics/statistics.pages.inc
statistics_user_tracker in core/modules/statistics/statistics.pages.inc
system_init in core/modules/system/system.module
Implementation of hook_init().
tagadelic_block in contrib/tagadelic/tagadelic.module
implementation of hook_block
template_preprocess_page in core/includes/theme.inc
Process variables for page.tpl.php
template_preprocess_profile_wrapper in core/modules/profile/profile.module
Process variables for profile-wrapper.tpl.php.
theme_imagefield_image_imagecache_lightbox2 in contrib/lightbox2/lightbox2.formatter.inc
Generate the HTML output for imagefield + imagecache images so they can be opened in a lightbox by clicking on the image on the node page or in a view.
theme_lightbox2_emimage in contrib/lightbox2/lightbox2.formatter.inc
Generate the HTML output to open embedded cck images in a lightbox.
theme_uc_payment_method_credit_form in contrib/ubercart/payment/uc_credit/uc_credit.module
theme_webform_results_submissions in contrib/webform/webform_report.inc
Theme the submissions tab of the webform results page.
thickbox_form_alter in contrib/thickbox/thickbox.module
Implementation of hook_form_alter(). Reformat the login form.
tinymce_admin in contrib/tinymce/tinymce.admin.inc
Controller for tinymce administrative settings.
tinymce_profile_form_build in contrib/tinymce/tinymce.admin.inc
Return an HTML form for profile configuration.
uc_2checkout_finalize in contrib/ubercart/payment/uc_2checkout/uc_2checkout.pages.inc
uc_2checkout_ucga_display in contrib/ubercart/payment/uc_2checkout/uc_2checkout.module
Implementation of hook_ucga_display().
uc_credit_menu in contrib/ubercart/payment/uc_credit/uc_credit.module
Implementation of hook_menu().
uc_credit_order in contrib/ubercart/payment/uc_credit/uc_credit.module
Implementation of hook_order().
uc_credit_payment_method in contrib/ubercart/payment/uc_credit/uc_credit.module
Implementation of hook_payment_method().
uc_googleanalytics_display in contrib/ubercart/uc_googleanalytics/uc_googleanalytics.module
Determine whether or not to display the e-commerce related JS through GA.
uc_googleanalytics_order in contrib/ubercart/uc_googleanalytics/uc_googleanalytics.module
Implementation of hook_order().
uc_order_admin in contrib/ubercart/uc_order/uc_order.admin.inc
Display the main order admin screen, an overview of all received orders.
uc_order_init in contrib/ubercart/uc_order/uc_order.module
Implementation of hook_init().
uc_order_search_form in contrib/ubercart/uc_order/uc_order.module
Form to input search parameters for orders. See alsouc_order_search_form_submit()
uc_order_select_customer in contrib/ubercart/uc_order/uc_order.admin.inc
Present the customer search results and let one of them be chosen. See alsouc_order_select_customer_form()
uc_order_select_customer_form in contrib/ubercart/uc_order/uc_order.admin.inc
Form to choose a customer from a list. See alsouc_order_select_customer()
uc_order_usearch in contrib/ubercart/uc_order/uc_order.admin.inc
Display a search form to browse all received orders.
uc_order_view in contrib/ubercart/uc_order/uc_order.admin.inc
Display the order view screen, constructed via hook_order_pane().
uc_payment_method_credit_form in contrib/ubercart/payment/uc_credit/uc_credit.module
uc_product_features in contrib/ubercart/uc_product/uc_product.admin.inc
Displays the product features tab on a product node edit form.
uc_product_feature_add_form_submit in contrib/ubercart/uc_product/uc_product.admin.inc
@see uc_product_feature_add_form().
uc_product_feature_form in contrib/ubercart/uc_product/uc_product.module
Returns a form array with some default hidden values and submit button.
uc_product_feature_save in contrib/ubercart/uc_product/uc_product.module
Save a product feature to a product node.
uc_product_form_alter in contrib/ubercart/uc_product/uc_product.module
Implementation of hook_form_alter(). See alsouc_product_save_continue_submit()
uc_product_table in contrib/ubercart/uc_product/uc_product.module
Display product fields in a TAPIr table.
uc_product_table_header in contrib/ubercart/uc_product/uc_product.module
Return the table header for the product view table. See alsouc_product_table()
uc_quote_cart_pane in contrib/ubercart/shipping/uc_quote/uc_quote.module
Implementation of hook_cart_pane().
uc_reports_init in contrib/ubercart/uc_reports/uc_reports.module
Implementation of hook_init().
uc_reports_products_custom in contrib/ubercart/uc_reports/uc_reports.admin.inc
Display the custom product report.
uc_reports_sales_custom in contrib/ubercart/uc_reports/uc_reports.admin.inc
Display the custom sales report form and table.
uc_reports_sales_year in contrib/ubercart/uc_reports/uc_reports.admin.inc
Display the yearly sales report form and table.
uc_stock_report in contrib/ubercart/uc_stock/uc_stock.admin.inc
Display a stock report for products with stock tracking enabled.
uc_stock_report_form in contrib/ubercart/uc_stock/uc_stock.admin.inc
Form builder for stock report threshold filter. See alsouc_stock_report_form_submit()
uc_store_customer_search in contrib/ubercart/uc_store/uc_store.admin.inc
Display the customer search page.
uc_store_customer_search_form in contrib/ubercart/uc_store/uc_store.admin.inc
The customer search form. See alsouc_store_customer_search_form_submit()
update_help in core/modules/update/update.module
Implementation of hook_help().
userreference_user in contrib/cck/modules/userreference/userreference.module
Implementation of hook_user().
user_admin_role in core/modules/user/user.admin.inc
Menu callback: administer roles. See alsouser_admin_role_validate()
user_block in core/modules/user/user.module
Implementation of hook_block().
webform_client_form in contrib/webform/webform.module
Client form generation function. If this is displaying an existing submission, pass in the $submission variable with the contents of the submission to be displayed.
zen_breadcrumb in contrib/zen/zen/template.php
Return a themed breadcrumb trail.
zen_preprocess_page in contrib/zen/zen/template.php
Override or insert variables into the page templates.
_i18n_get_context_lang in contrib/i18n/i18n.module
Get language from context
_nodewords_detect_type_and_ids in contrib/nodewords/nodewords.module
Try to guess the $type and $ids by looking at $_GET['q'].
_trigger_normalize_user_context in core/modules/trigger/trigger.module
When an action is called in a context that does not match its type, the object that the action expects must be retrieved. For example, when an action that works on nodes is called during the user hook, the node object is not available since the user...
_uc_catalog_navigation in contrib/ubercart/uc_catalog/uc_catalog.module
Emulate Drupal's menu system, but based soley on the structure of "Product Catalog".
_zen_theme in contrib/zen/zen/template.theme-registry.inc
Implements HOOK_theme().

Code

core/includes/path.inc, line 159

<?php
function arg($index = NULL, $path = NULL) {
  static $arguments;

  if (!isset($path)) {
    $path = $_GET['q'];
  }
  if (!isset($arguments[$path])) {
    $arguments[$path] = explode('/', $path);
  }
  if (!isset($index)) {
    return $arguments[$path];
  }
  if (isset($arguments[$path][$index])) {
    return $arguments[$path][$index];
  }
}
?>