Difference between revisions of "How to add own link to "Useful Links" block in member's area"

From aMember Pro Documentation
Jump to: navigation, search
Line 2: Line 2:
 
<source>
 
<source>
 
<?php  
 
<?php  
Am_Di::getInstance()->hook->add(Am_Event::GET_MEMBER_LINKS, 'getLinks');
+
Am_Di::getInstance()->hook->add(Am_Event::GET_MEMBER_LINKS, function (Am_Event $event){
function getLinks(Am_Event $event){
+
 
     $event->addReturn('LINK TITLE', '/url/');
 
     $event->addReturn('LINK TITLE', '/url/');
}
+
});
 
+
 
</source>
 
</source>

Revision as of 04:54, 5 February 2016

Add this code to site.php file:

<?php 
Am_Di::getInstance()->hook->add(Am_Event::GET_MEMBER_LINKS,  function (Am_Event $event){
    $event->addReturn('LINK TITLE', '/url/');
});