Upgrade to Pro — share decks privately, control downloads, hide ads and more …

EC-CUBE3デザイナー向け勉強会 #3

EC-CUBE3デザイナー向け勉強会 #3

amidaike

March 10, 2016
Tweet

More Decks by amidaike

Other Decks in Programming

Transcript

  1. Formग़ྗؔ਺ • form_label(view, label, variables)
 ࢦఆͨ͠ϑΟʔϧυͷϥϕϧΛग़ྗ͠·͢ɻୈೋҾ਺ͱ ͯ͠ɺ͜ͷϑΟʔϧυʹग़ྗ͍ͨ͠ϥϕϧΛ౉͢͜ͱ΋ Ͱ͖·͢ɻ {{ form_label(form.name)

    }} {# Լهͷೋͭͷॻ͖ํ͸ಉ͡ҙຯʹͳΓ·͢ #} {{ form_label(form.name, '໊͓લ', {'label_attr': {'class': 'foo'}}) }} {{ form_label(form.name, null, {'label': '໊͓લ', 'label_attr': {'class': 'foo'}}) }}
  2. Formม਺ • ϑΥʔϜͷͲͷ෦෼Λग़ྗ͢Δͱ͖Ͱ΋ɺͦͷ෦෼Λ ग़ྗ͢ΔϒϩοΫ͸ͨ͘͞Μͷม਺Λ࢖͍·͢ɻ σ ϑΥϧτͰ͸ɺϒϩοΫ͸form_div_layout.html.twig ͷதʹॻ͔Ε͍ͯ·͢ɻ {% block form_label

    %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% endif %} {% if label is empty %} {% set label = name|humanize %} {% endif %}
  3. Formม਺ • ςϯϓϨʔτʹ form ม਺ؚ͕·Ε͍ͯͯnameϑΟʔ ϧυͷม਺ʹΞΫηε͍ͨ͠ͱ͖ɺ FormViewΦϒδΣ ΫτͷvarsϓϩύςΟΛ࢖͏͜ͱʹΑΓΞΫηεͰ͖· ͢ɻ <label

    for="{{ form.name.vars.id }}" class="{{ form.name.vars.required ? 'required' : '' }}"> {{ form.name.vars.label }} </label>
  4. ϑΥʔϜϨΠΞ΢τ • EC-CUBE3Ͱ͸ϑΥʔϜը໘Λར༻͢Δ৔߹ɺ
 ECCUBEROOT/src/Eccube/Resource/template/default/Form/form_layout.twig
 ECCUBEROOT/src/Eccube/Resource/template/admin/Form/ bootstrap_3_horizontal_layout.html.twig
 Λݩʹͯ͠ग़ྗ͞Ε͍ͯ·͢ɻ
 • ͜ͷϑΥʔϜΛར༻͢Δ৔߹ɺݺͼग़͠ݩͷTwigଆͰ͸
 {%

    form_theme form 'Form/form_layout.twig' %}
 {% form_theme form 'Form/bootstrap_3_horizontal_layout.html.twig' %}
 ͱهड़͢Δ͜ͱͰڞ௨ͱͳΔϑΥʔϜը໘͕࡞੒͞Ε·͢ɻ
 ※ݱঢ়Ͱ͸ϑϩϯτଆͰ͸form_layout.twig͸ར༻͞Ε͓ͯΒͣɺTwigඪ४ͷ form_div_layout.html.twig͕ద༻͞Ε͍ͯ·͢ɻ
  5. ։ൃ࣌ͷখ࿩ • Τϥʔͷݟํ͸Ͳ͏͢Δͷ? • TwigͰphp͸࢖͑ͳ͍ͷ?
 ࢀߟURL) https://github.com/EC-CUBE/ec-cube/issues/1320 • URLͷ֬ೝͷ࢓ํ͸Ͳ͏͢Δͷ?
 ࢀߟURL)

    http://ec-cube.github.io/tips.html • URLΛมߋ͍ͨ͠৔߹ɺͲ͏͢Δͷ? • ը໘ભҠਤΈ͍ͨͳͷ͸ͳ͍ͷ? • URLʹhtmlΛ͚ͭͳ͍ํ๏͸Ͳ͏͢Δͷ?
 ࢀߟURL) http://amidaike.hatenablog.com/entry/2016/02/11/054219 • σβΠϯͷมߋ͸Ͳ͏͢Δͷ?