|
Revision 7779, 1.7 kB
(checked in by fabien, 5 years ago)
|
change sfRouting::generate() signature to allow optional parameter value
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
class sfNoRouting extends sfRouting |
|---|
| 20 |
{ |
|---|
| 21 |
|
|---|
| 22 |
* @see sfRouting |
|---|
| 23 |
*/ |
|---|
| 24 |
public function getCurrentInternalUri($with_route_name = false) |
|---|
| 25 |
{ |
|---|
| 26 |
$parameters = $this->fixDefaults($this->mergeArrays($this->defaultParameters, $_GET)); |
|---|
| 27 |
$action = sprintf('%s/%s', $parameters['module'], $parameters['action']); |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
unset($parameters['module'], $parameters['action']); |
|---|
| 31 |
ksort($parameters); |
|---|
| 32 |
$parameters = count($parameters) ? '?'.http_build_query($parameters, null, '&') : ''; |
|---|
| 33 |
|
|---|
| 34 |
return sprintf('%s%s', $action, $parameters); |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
* @see sfRouting |
|---|
| 39 |
*/ |
|---|
| 40 |
public function generate($name, $params = array(), $querydiv = '/', $divider = '/', $equals = '/') |
|---|
| 41 |
{ |
|---|
| 42 |
$parameters = http_build_query($this->mergeArrays($this->defaultParameters, $params), null, '&'); |
|---|
| 43 |
|
|---|
| 44 |
return '/'.($parameters ? '?'.$parameters : ''); |
|---|
| 45 |
} |
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
* @see sfRouting |
|---|
| 49 |
*/ |
|---|
| 50 |
public function parse($url) |
|---|
| 51 |
{ |
|---|
| 52 |
return array(); |
|---|
| 53 |
} |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
* @see sfRouting |
|---|
| 57 |
*/ |
|---|
| 58 |
public function getRoutes() |
|---|
| 59 |
{ |
|---|
| 60 |
return array(); |
|---|
| 61 |
} |
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
* @see sfRouting |
|---|
| 65 |
*/ |
|---|
| 66 |
public function setRoutes($routes) |
|---|
| 67 |
{ |
|---|
| 68 |
return array(); |
|---|
| 69 |
} |
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
* @see sfRouting |
|---|
| 73 |
*/ |
|---|
| 74 |
public function hasRoutes() |
|---|
| 75 |
{ |
|---|
| 76 |
return false; |
|---|
| 77 |
} |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
* @see sfRouting |
|---|
| 81 |
*/ |
|---|
| 82 |
public function clearRoutes() |
|---|
| 83 |
{ |
|---|
| 84 |
} |
|---|
| 85 |
} |
|---|
| 86 |
|
|---|