Skip to content

Commit d3cf54b

Browse files
committed
Merge pull request #157 from symfony-cmf/flag_getter_setter
[WIP] added getters and setters for route flags
2 parents 69b2a19 + 9a36ea8 commit d3cf54b

File tree

7 files changed

+56
-2
lines changed

7 files changed

+56
-2
lines changed

Admin/RouteAdmin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ protected function configureFormFields(FormMapper $formMapper)
6565
array('choice_list' => array(), 'select_root_node' => true, 'root_node' => $this->routeRoot)
6666
)
6767
->add('name', 'text')
68+
->add('addFormatPattern')
69+
->add('addTrailingSlash')
6870
->end();
6971

7072
if (null === $this->getParentFieldDescription()) {

Doctrine/Phpcr/Route.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ class Route extends RouteModel implements PrefixInterface
5454
/**
5555
* Overwrite to be able to create route without pattern
5656
*
57-
* @param bool $addFormatPattern if to add ".{_format}" to the route pattern
57+
* @param Boolean $addFormatPattern if to add ".{_format}" to the route pattern
5858
* also implicitly sets a default/require on "_format" to "html"
59-
* @param bool $addTrailingSlash whether to add a trailing slash to the route, defaults to not add one
59+
* @param Boolean $addTrailingSlash whether to add a trailing slash to the route, defaults to not add one
6060
*/
6161
public function __construct($addFormatPattern = false, $addTrailingSlash = false)
6262
{
@@ -66,6 +66,16 @@ public function __construct($addFormatPattern = false, $addTrailingSlash = false
6666
$this->addTrailingSlash = $addTrailingSlash;
6767
}
6868

69+
public function getAddTrailingSlash()
70+
{
71+
return $this->addTrailingSlash;
72+
}
73+
74+
public function setAddTrailingSlash($addTrailingSlash)
75+
{
76+
$this->addTrailingSlash = $addTrailingSlash;
77+
}
78+
6979
/**
7080
* Move the route by setting a parent.
7181
*

Model/Route.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ public function __construct($addFormatPattern = false)
7878
}
7979
}
8080

81+
public function getAddFormatPattern()
82+
{
83+
return $this->addFormatPattern;
84+
}
85+
86+
public function setAddFormatPattern($addFormatPattern)
87+
{
88+
$this->addFormatPattern = $addFormatPattern;
89+
}
90+
8191
/**
8292
* {@inheritDoc}
8393
*/

Resources/translations/CmfRoutingBundle.de.xliff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@
9898
<source>form.label_routes</source>
9999
<target>Routen</target>
100100
</trans-unit>
101+
<trans-unit id=" form.label_add_format_pattern">
102+
<source>form.label_add_format_pattern</source>
103+
<target>Add format pattern</target>
104+
</trans-unit>
105+
<trans-unit id=" form.label_add_trailing_slash">
106+
<source>form.label_add_trailing_slash</source>
107+
<target>Add trailing slash</target>
108+
</trans-unit>
101109
</body>
102110
</file>
103111
</xliff>

Resources/translations/CmfRoutingBundle.en.xliff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@
9898
<source>form.label_routes</source>
9999
<target>Routes</target>
100100
</trans-unit>
101+
<trans-unit id=" form.label_add_format_pattern">
102+
<source>form.label_add_format_pattern</source>
103+
<target>Add format pattern</target>
104+
</trans-unit>
105+
<trans-unit id=" form.label_add_trailing_slash">
106+
<source>form.label_add_trailing_slash</source>
107+
<target>Add trailing slash</target>
108+
</trans-unit>
101109
</body>
102110
</file>
103111
</xliff>

Resources/translations/CmfRoutingBundle.fr.xliff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@
9898
<source>form.label_routes</source>
9999
<target>Routes</target>
100100
</trans-unit>
101+
<trans-unit id=" form.label_add_format_pattern">
102+
<source>form.label_add_format_pattern</source>
103+
<target>Add format pattern</target>
104+
</trans-unit>
105+
<trans-unit id=" form.label_add_trailing_slash">
106+
<source>form.label_add_trailing_slash</source>
107+
<target>Add trailing slash</target>
108+
</trans-unit>
101109
</body>
102110
</file>
103111
</xliff>

Resources/translations/CmfRoutingBundle.pl.xliff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@
9898
<source>form.label_routes</source>
9999
<target>Ścieżki</target>
100100
</trans-unit>
101+
<trans-unit id=" form.label_add_format_pattern">
102+
<source>form.label_add_format_pattern</source>
103+
<target>Add format pattern</target>
104+
</trans-unit>
105+
<trans-unit id=" form.label_add_trailing_slash">
106+
<source>form.label_add_trailing_slash</source>
107+
<target>Add trailing slash</target>
108+
</trans-unit>
101109
</body>
102110
</file>
103111
</xliff>

0 commit comments

Comments
 (0)