eccubevn / ec-cube

EC-CUBE official repository
http://www.ec-cube.net
Other
1 stars 2 forks source link

[3n]-[Plugin]-[template] using include template when disable plugin #120

Closed hoand-vn closed 6 years ago

hoand-vn commented 6 years ago

概要(Overview)

When plugin disable, but include template of plugin still working => error

期待する内容(Expect) or 要望 (Requirement)

When plugin disable, any function for template of plugin also NOT run

再現手順(Procedure)

Solution

環境 (environment)

関連情報 (Ref)

chihiro-adachi commented 6 years ago

管理画面

TemplateEvent::addSnipetを使用する https://github.com/EC-CUBE/ec-cube/pull/3244

フロント

Includeではなく、TwigBlockを作成する https://github.com/EC-CUBE/ec-cube/pull/3232

既存のhtmlを変更する必要がある場合は、TemplateEvent::addSnipetを使用してください

参考

決済プラグインサンプルに実装があります https://github.com/EC-CUBE/sample-payment-plugin https://github.com/EC-CUBE/sample-payment-plugin/blob/master/SamplePaymentTwigBlock.php https://github.com/EC-CUBE/sample-payment-plugin/blob/master/SamplePaymentEvent.php

https://github.com/EC-CUBE/sample-payment-plugin#twig%E3%83%A6%E3%83%BC%E3%82%B6%E5%AE%9A%E7%BE%A9%E9%96%A2%E6%95%B0%E3%81%AE%E8%AA%AD%E3%81%BF%E8%BE%BC%E3%81%BF

https://github.com/EC-CUBE/sample-payment-plugin#%E7%94%BB%E9%9D%A2%E3%81%B8%E3%81%AE%E4%BB%8B%E5%85%A5%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6

lqdung-lockon commented 6 years ago

answered => close

hoand-vn commented 6 years ago

@chihiro-adachi san, we have 2 question about using TwigBlock - addSnipet

Question: 1) Can we use addSnipet () to add content in template ( not use TwigBlock ) ? 2) If only use addSnippet => TwigBlock will never be used ( TwigBlock redundant ) ?

hoand-vn commented 6 years ago

almost using Snippet as payment example plugin