hook_path_insert

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 hook_path_insert($path)

Allow modules to respond to a path being inserted.

Parameters

$path An associative array containing the following keys:

  • source: The internal system path.
  • alias: The URL alias.
  • pid: Unique path alias identifier.
  • language: The language of the alias.

See also

path_save()

Related topics

Code

modules/path/path.api.php, line 26

<?php
function hook_path_insert($path) {
  db_insert('mytable')
    ->fields(array(
    'alias' => $path['alias'], 
    'pid' => $path['pid'],
  ))
    ->execute();
}
?>