In path parameter I want to use like::

'path' => '*/businesses',

In place of "*" there could be any city. So this url could be any of the following:

- karachi/businesses
- lahore/businesses
- Islamabad/businesses

etc....

I used the code above but it is not working.

Comments

Michsk’s picture

I dont know if you can achieve this with the drupal standard menu. You could use views and arguments tough.

errorist’s picture

but I have seen some urls like "node/*"
this means after "node" there could be anything and can be accessed as arg(1).

??

morganchad’s picture

In hook_menu, it uses a % sign instead of an *.

But I'm not sure if you're using hook_menu here because the path is defined differently. e.g.

hook_menu(i can't remember if there any parameters) {
$items['this_is_your_path/%/ad'] = array(
  'type' => MENU_CALLBACK,
  'page callback' => 'function_that_runs_when_page_is_loaded',
  'page arguments' => array(1),
);
return $items;
}

When using this, in page_arguments, the number in array is the position of the % starting with 0. If your path was %/item1/item2/ then it would be array(0).