Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twig のユーザー定義関数を実装 #2263

Merged
merged 7 commits into from
Apr 12, 2017

Conversation

nanasess
Copy link
Contributor

概要(Overview・Refs Issue)

  • Twig で PHP 関数をコールできるようにする実装(twigでのphp関数の呼び出し機構を廃止 #1320)
  • eccube.twig.block.templates に定義したテンプレートに記述した Twig block を、ユーザー定義関数 (eccube_block_<block name>()) で呼び出せる実装
  • [実験的]Twig のカスタムタグ実装

方針(Policy)

  • Twite ボタンのような、再利用可能な Twig コンポーネントを簡単に実装できる仕組みをつくる
  • JSP taglib のようなイメージ

実装に関する補足(Appendix)

  • Twig macro でも同様なことを実現可能だが、 Non Programmer でも利用できるよう技術的な障壁を下げる

テスト(Test)

  • Eccube\Tests\Twig\Extension\FunctionsTest にテストケースを記載

相談(Discussion)

  • Twig 関連の処理を用途ごとに ServiceProvider へ分割した方が良さげ。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants