Legacy urls

Permalink
Hi,

I have just a little question :

Why using legacy urls (ENABLE_LEGACY_CONTROLLER_URLS) ?

Thanks.

moosh
 
kino replied on at Permalink Reply
kino
\concrete\libraries\view.php line 421
if (ENABLE_LEGACY_CONTROLLER_URLS) {
   $_action .= '-/' . $task;
} else {
   $_action .= $task;         
}


\concrete\libraries\request.php line 126
if (defined('ENABLE_LEGACY_CONTROLLER_URLS') && ENABLE_LEGACY_CONTROLLER_URLS == true) {
   if (preg_match("/^\-\/(.[^\/]*)\/(.*)/i", $path, $matches)) {
      $this->task = $matches[1];
      $this->params = $matches[2];
      return;
   }
   // home page w/just task
   if (preg_match("/^\-\/(.[^\/]*)/i", $path, $matches)) {
      $this->task = $matches[1];
      return;
   }
   // path + task + params
   if (preg_match("/^(.[^\.]*)\/\-\/(.[^\/]*)\/(.*)/i", $path, $matches)) {
      $this->cPath = $matches[1];
      $this->task = $matches[2];
moosh replied on at Permalink Reply
moosh
Thanks.

But why adding '-/' in url ?
kino replied on at Permalink Reply
kino
after '-/' is parameter.
andrew replied on at Permalink Best Answer Reply
andrew
Before the /-/ comes the path to the page. Afterwards comes the method being run by the page's controller, and after that comes the list of parameters. Since paths to pages can be any length the /-/ helps tell you where the page stops and the method begins.

However, we have a smart method for getting around that now, so you don't have to have urls that are polluted with the /-/ (which some find ugly). It comes with a very slight performance hit and occasionally some wonky behavior, so we made it a switch that you can turn off if your site (which would have to be very custom to be affected by this) didn't work with our new request system.