You are here

function search_by_page_path_parts in Search by Page 7

Same name and namespace in other branches
  1. 6 search_by_page.module \search_by_page_path_parts()

Splits a path into the main path and any query parts.

Parameters

$path: Path to split.

Return value

Array, first element is main path (after resolving aliases), second is query string.

4 calls to search_by_page_path_parts()
sbp_paths_sbp_query_modify in ./sbp_paths.module
Implements Search by Page hook_sbp_query_modify().
SearchByPageUnitTest::testPathParts in tests/search_by_page.test
Tests the search_by_page_path_parts() function.
search_by_page_page_content in ./search_by_page.module
Returns the content portion of the rendered page at the given path.
search_by_page_search_execute in ./search_by_page.module
Implements hook_search_execute().

File

./search_by_page.module, line 201
Main module file for Drupal module Search by Page.

Code

function search_by_page_path_parts($path) {

  // see if there is a ? in the path
  $path = drupal_get_normal_path($path);
  $stuff = explode('?', $path, 2);
  if (count($stuff) > 1) {
    return $stuff;
  }

  // see if there is an & in the path
  return explode('&', $path, 2);
}