Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save antonkril/6642207 to your computer and use it in GitHub Desktop.
Save antonkril/6642207 to your computer and use it in GitHub Desktop.
Magento 2 Interception Demo code
<config>
<type name="Magento_Backend_Model_Menu_Item">
<plugin name="ILovePlugins" type="Apple_IDontCare_Model_Menu_Item_Plugin" sortOrder="100" />
</type>
</config>
<config>
<module name="Apple_IDontCare" version="1.0.0.0" active="true"/>
</config>
<?php
class Apple_IDontCare_Model_Menu_Item_Plugin
{
public function afterGetTitle($result)
{
return '^' . $result . '^';
}
}
<config>
<type name="Magento_Backend_Model_Menu_Item">
<plugin name="kernel" type="Google_Nostromo_Model_Menu_Item_Plugin" sortOrder="200" />
</type>
</config>
<config>
<module name="Google_Nostromo" version="1.0.0.0" active="true" />
</config>
<?php
class Google_Nostromo_Model_Menu_Item_Plugin
{
public function afterGetTitle($result)
{
return '(' . $result . ')';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment