Created
June 18, 2020 18:15
-
-
Save cgi-caesar/f1989d535635b38cadbdf08d5a68130c to your computer and use it in GitHub Desktop.
Widget Example Plugin
This file contains hidden or 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 | |
/** | |
* @title Widget Foo Bar | |
* @path application/default/plugins/misc/widget-foobar.php | |
*/ | |
class Am_Plugin_WidgetFoobar extends Am_Plugin | |
{ | |
const PLUGIN_STATUS = self::STATUS_BETA; | |
Const PLUGIN_COMM = self::COMM_COMMERCIAL; | |
const PLUGIN_REVISION = '@@VERSION@@'; | |
protected $_configPrefix = 'misc.'; | |
function onInitBlocks(Am_Event $e) | |
{ | |
$e->getBlocks()->add( | |
'member/main/left', | |
new Am_Block_Base( | |
'Widget Title', | |
'widget-id', | |
null, | |
function (Am_View $v) { | |
return <<<CUT | |
<p>Any Content here!</p> | |
CUT; | |
} | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment