[Quickcast] Creating a new module in Magento2 A 3-part quickcast series demonstrating how to create a new module in Magento2, how to utilize the new Interception functionality, and how to chain multiple plugins targeting the same functionality together.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<type name="Magento\Backend\Model\Menu\Item"> | |
<plugin name="myname2" type="Philwinkle\Module2\Model\Plugin" sortOrder="100"/> | |
</type> | |
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<module name="Philwinkle_Module2" version="0.0.1.0" active="true"></module> | |
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Philwinkle\Module2\Model; | |
class Plugin | |
{ | |
public function afterGetTitle($value) | |
{ | |
return '==' . $value . '=='; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<type name="Magento\Backend\Model\Menu\Item"> | |
<plugin name="myname" type="Philwinkle\Module\Model\Plugin" sortOrder="50"/> | |
</type> | |
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<module name="Philwinkle_Module" version="0.0.1.0" active="true"></module> | |
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Philwinkle\Module\Model; | |
class Plugin | |
{ | |
public function afterGetTitle($value) | |
{ | |
return '(' . $value . ')'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment