{ Hello Magento 2 }

解决 Magento 2 应用问题,更注重深度挖掘。(ง •̀_•́)ง

0%

plugins(interceptor) best practice

Notes

  • Around-plugins SHOULD only be used when behavior of an original method is supposed to be substituted in certain scenarios.
  • Plugins SHOULD NOT be used within own module.
  • Plugins SHOULD NOT be added to data objects. ( why? )
  • Plugins MUST be stateless.
  • Plugins SHOULD NOT change the state of an intercepted object (Intercepted object is $subject).

plugins SHOULD BE used for modifying the input or output of a function.

References

technical-guidelines-interception