url — Get a URL given the provided arguments.

Navigation-related functions

Summary

Returns a URL to a page in an Omeka site. This function can be used to create links between different pages on the site.

Plugin and theme writers should always use this helper when linking between pages. Hand-written or “bare” URLs are generally only valid for a particular Omeka installation. This helper generates relative URLs that are valid regardless of where an Omeka installation is located on a server.

url($options = array(), $route = null, $queryParams = array(), $reset = false, $encode = true)

Get a URL given the provided arguments.

Instantiates view helpers directly because a view may not be registered.

Parameters:
  • $options (mixed) – If a string is passed it is treated as an Omeka-relative link. So, passing ‘items’ would create a link to the items page. If an array is passed (or no argument given), it is treated as options to be passed to Omeka’s routing system. Note that in the Url Helper, if the first argument is a string, the second argument, not the third, is the queryParams
  • $route (string) – The route to use if an array is passed in the first argument.
  • $queryParams (mixed) – A set of query string parameters to append to the URL
  • $reset (bool) – Whether Omeka should discard the current route when generating the URL.
  • $encode (bool) – Whether the URL should be URL-encoded
Returns:

string HTML

Usage

Examples