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

Symfony/Asset の導入 #2608

Merged
merged 7 commits into from
Nov 6, 2017
Merged

Conversation

chihiro-adachi
Copy link
Contributor

概要(Overview・Refs Issue)

  • Symfomy/Assetを導入しています

方針(Policy)

※ css管理実装にあたっての前提事項

  • 標準で、style.cssとstyle,min.cssを同梱
  • css管理ではstyle.cssを読み書きする
  • css管理でファイル保存時に、style.min.cssを再生成する
  • テンプレート側では常にstyle.min.cssを参照する

実装に関する補足(Appendix)

テンプレートのURL記述

フロント
html/template/default/assets/css/style.min.css?v=3.n

-    <link rel="stylesheet" href="{{ app.config.front_urlpath }}/assets/css/style.css?v={{ constant('Eccube\\Common\\Constant::VERSION') }}">
+    <link rel="stylesheet" href="{{ asset('assets/css/style.min.css') }}">

管理
html/template/admin/assets/css/style.min.css?v=3.n

-    <link rel="stylesheet" href="{{ app.config.admin_urlpath }}/assets/css/style.css?v={{ constant('Eccube\\Common\\Constant::VERSION') }}">
+    <link rel="stylesheet" href="{{ asset('assets/css/style.min.css', 'admin') }}">

商品画像系
html/upload/xxx.jpg

-    <link rel="stylesheet" href="{{ app.config.save_image_urlpath }}/{{ Product.main_list_image}}">
+    <link rel="stylesheet" href="{{ asset(Product.main_list_image, 'save_image') }}">

プラグイン
html/plugin/CategoryContent/xxx.jpg

-    <link rel="stylesheet" href="{{ app.config.plugin_urlpath }}/xxx.jpg">
+    <link rel="stylesheet" href="{{ asset('CategoryContent/xxx.jpg', 'plugin') }}">

テスト(Test)

  • travic-ciにパスしていることを確認

相談(Discussion)

関連:#577

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

Successfully merging this pull request may close these issues.

2 participants