Package: Application\Resource

class Omeka_Application_Resource_Router

extends Zend_Application_Resource_Router

Set up the router and the built-in routes.


Adds the homepage route to the router (as specified by the navigation settings page) The route will not be added if the user is currently on the admin theme.

  • $router (Zend_Controller_Router_Rewrite) – The router
Omeka_Application_Resource_Router::addRedirectRouteForDefaultRoute($routeName, $uri, $params = array(), $router = null)

Adds a redirect route for the default route and returns whether the route was successfully added If the current request matches the default route, then the flow will redirect to the index action of the RedirectorController, where the page will be redirected to the absolute uri We must use this Redirector proxy controller because a user may be redirecting to an admin page and it needs to reload the application from the admin context. Also, the Zend router and dispatcher does not allow us to directly dispatch to an absolute uri.

  • $routeName (String) – The name of the new redirect route
  • $uri (String) – The absolute uri to redirect to the default route to
  • $params (array) – The parameters for the redirect route.
  • $router (Zend_Controller_Router_Rewrite) – The router

boolean Returns true if the route was successfully added, else false.

Omeka_Application_Resource_Router::_leftTrim($s, $n)

Left trims the first occurrence of a string within a string. Note: it will only trim the first occurrence of the string.

  • $s (string) – The base string
  • $n (string) – The string to remove from the left side of the base string