Author:
jensscherbl
Version:
1.0
Released:
27 October 2013
Category:
Workflow, and Other

Browse

Description

Configuration

By default, the extension stores a routes.xml file in your workspace folder.

However, a new setting is also added to your config.php, where you can provide an alternative file path relative to the workspace folder.

Attention

This extension completely replaces Symphony's default routing.

This means it will throw a FrontendPageNotFoundException and display a 404 page for every path that's not defined in your routes.xml file, even if the page actually exists.

Caching

For better performance, the routes.xml file is only processed once and then cached using Symphony's Cacheable API.

It's therefore necessary to refresh the cache after making changes in your routes.xml or config.php.

This can be done by simply re-enabling the extension under System › Extensions.

Schema

The routes.xml schema is pretty simple.

<routes>
    <route from="..." to="..." />
    <route from="..." to="...">
        <filter parameter="..." match="..." />
    </route>
</routes>

Routes

Each route is defined by a <route> element, which has two attributes, @from and @to.

These attributes contain pathes relative to your root URL.

<route from="/en/about-us/"  to="/about-us/" />
<route from="/de/ueber-uns/" to="/about-us/" />

The @from path, which your users see in their browser address bar, is silently routed to an existing page path.

Parameters

Parameters are declared by a leading : and can be reused in the @to path.

<route from="/:language/blog/:article/" to="/blog/:article/" />

Filters

To match a parameter against a specific pattern, you can optionally provide a <filter> element for that parameter inside the <route> element.

A <filter> element also has two attributes, @parameter and @match.

<route from="/:language/blog/:article/" to="/blog/:article/">

    <filter parameter=":language" match="[a-z]{2}" />

</route>

The @match attribute can contain a PCRE regex pattern.

By default, all parameters will be matched against the [w.-]+ pattern.

Repository

http://github.com/jensscherbl/routing

Discuss this Extension

Compatibility

2.7.10 Unsure
2.7.9 Unsure
2.7.8 Unsure
2.7.7 Unsure
2.7.6 Unsure
2.7.5 Unsure
2.7.4 Unsure
2.7.3 Unsure
2.7.2 Unsure
2.7.1 Unsure
2.7.0 Unsure
2.6.11 Unsure
2.6.10 Unsure
2.6.9 Unsure
2.6.8 Unsure
2.6.7 Unsure
2.6.6 Unsure
2.6.5 Unsure
2.6.4 Unsure
2.5.4 Unsure

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details