回答編集履歴

1

2015/02/10 02:52

投稿

hamham
hamham

スコア41

test CHANGED
@@ -1,29 +1,13 @@
1
1
  以下のようにすれば、たぶんいけると思いますよ。
2
-
3
2
  ちょっと試してみてください。
4
3
 
5
-
6
-
7
- ```lang-<ここに言語を入力>
8
-
9
4
  <ul id="language-selector">
10
-
11
5
  {% if app.request.attributes.get('_route') == 'samplepage' %}
12
-
13
6
  <li><a href="{{ path("samplepage", {"_locale": "jp"}) }}">JP</a></li>
14
-
15
7
  <li><a href="{{ path("samplepage", {"_locale": "en"}) }}">EN</a></li>
16
-
17
8
  {% else %}
18
-
19
9
  <li><a href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale': 'jp'})) }}">JP</a></li>
20
-
21
10
  <li><a href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale': 'en'})) }}">EN</a></li>
22
-
23
11
  {% endif %}
24
-
25
12
  </ul>
26
13
 
27
- ```
28
-
29
-