Skip to content

Commit

Permalink
pageリソースでLinkアトリビュートが期待通りに働いていない
Browse files Browse the repository at this point in the history
pageリソースへ表示確認用の編集を加えている。
$ vi src/Resource/Page/Index.php
$ vi src/Resource/Page/Next.php

この状態で、appリソースは従来どおりだが

$ php bin/app.php get /
$ php bin/app.php get '/weekday?year=2022&month=11&day=8'

pageリソースへのリクエストを実行すると...

$ php bin/page.php get /
$ php bin/page.php get '/next?year=2022&month=11&day=8'

pageリソースだとLinkが消失。
Embed は「組込み方の仕様がappリソースの時とは変わった」と理解すべきか。
(HTML出力内容の<pre>ブロック内を参照)
  • Loading branch information
Kimita committed Nov 9, 2022
1 parent aa5e74c commit 7546748
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion var/templates/Page/Index.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{% extends 'layout/base.html.twig' %}
{% block title %}Index{% endblock %}
{% block content %}
{{ greeting }}

<h1>{{ greeting }}</h1>

<pre>
{{ _ro | json_encode(constant('JSON_UNESCAPED_UNICODE') b-or constant('JSON_PRETTY_PRINT'))|raw}}
</pre>


{% endblock %}
7 changes: 7 additions & 0 deletions var/templates/Page/Next.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{% extends 'layout/base.html.twig' %}
{% block title %}Index{% endblock %}
{% block content %}

<h1>weekday of {{ year }}-{{ month }}-{{ day }} is {{ _embedded.weekday.weekday }}</h1>

<pre>
{{ _ro | json_encode(constant('JSON_UNESCAPED_UNICODE') b-or constant('JSON_PRETTY_PRINT'))|raw}}
</pre>


{% endblock %}

0 comments on commit 7546748

Please sign in to comment.