14.06.2013 Views

The Symfony CMF Book

The Symfony CMF Book

The Symfony CMF Book

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2<br />

Routing<br />

This is an introduction to understand the concepts behind <strong>CMF</strong> routing. For the reference<br />

documentation please see Routing and <strong>The</strong> RoutingBundle.<br />

Concept<br />

Why a new Routing Mechanism?<br />

CMS are highly dynamic sites, where most of the content is managed by the administrators rather than<br />

developers. <strong>The</strong> number of available pages can easily reach the thousands, which is usually multiplied<br />

by the number of available translations. Best accessibility and SEO practices, as well as user preferences<br />

dictate that the URLs should be definable by the content managers.<br />

<strong>The</strong> default <strong>Symfony</strong>2 routing mechanism, with its configuration file approach, is not the best solution<br />

for this problem. It does not provide a way of handling dynamic, user-defined routes, nor does it scale<br />

well to a large number of routes.<br />

<strong>The</strong> Solution<br />

In order to address these issues, a new routing system was developed that takes into account the typical<br />

needs of CMS routing:<br />

• User-defined URLs;<br />

• Multi-site;<br />

• Multi-language;<br />

• Tree-like structure for easier management;<br />

• Content, Menu and Route separation for added flexibility.<br />

With these requirements in mind, the <strong>Symfony</strong> <strong>CMF</strong> Routing component was developed.<br />

PDF brought to you by<br />

generated on June 13, 2013<br />

Chapter 2: Routing | 8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!