-
Notifications
You must be signed in to change notification settings - Fork 16
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
porting this plugin base on version sf #17
base: 4.0
Are you sure you want to change the base?
Conversation
PluginManager.php
Outdated
*/ | ||
public function enable($config, $app) | ||
public function enable($config = [], Application $app = null, ContainerInterface $container = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableの中の処理は、3.nでも必要ですか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
管理画面への要素の追加は、TemplateEvent::addSnipetを使用してください。
EC-CUBE#3244 -
フロントへの要素の追加は、TwigBlockを作成してください。
EC-CUBE#3232
既存のhtmlを変更する必要がある場合は、TemplateEvent::addSnipetを使用してください。
EventSubscriber.php
Outdated
*/ | ||
public function onFormPreSubmit(FormEvent $event) | ||
{ | ||
/** @var Category $Category */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formへのマッピングはもう不要なはずなので、このEventSubscriber自体不要なはずです。
'maxlength' => $this->eccubeConfig['category_text_area_len'], | ||
'placeholder' => $this->translator->trans('admin.plugin.category.content'), | ||
], | ||
])->addEventSubscriber(new EventSubscriber()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventで処理する必要はないです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @chihiro-adachi the reason I use event is:
- I append
content
input intoCategoryType
byCategoryTypeExtension
. content
input was not render on form (new category form & edit-inline category form)- Then when submit form (new category or edit-inline category), the POST does not contains key:value of
content
- It make value of
content
input always be null (see\Symfony\Component\Form\Form::submit
( line 572))
Resource/config/services.yml
Outdated
@@ -0,0 +1,2 @@ | |||
parameters: | |||
category_text_area_len: 4000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名規約に合わせてください。
category_content_text_area_len
Resource/locale/messages.ja.php
Outdated
@@ -0,0 +1,7 @@ | |||
<?php | |||
return [ | |||
'admin.plugin.category.content' => 'コンテンツを入力してください(HTMLタグ使用可)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名規約にあわせてください
EC-CUBE/sample-payment-plugin#6
config.yml
Outdated
orm.path: | ||
- /Resource/doctrine | ||
event: Event | ||
event: EventSubscriber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要
for fixing |
finish fixing |
@chihiro-adachi @ryo-endo 再レビューお願いします。 |
概要(Overview・Refs Issue)
方針(Policy)
- Change some logic business.
実装に関する補足(Appendix)