Skip to content

Instantly share code, notes, and snippets.

@cgi-caesar
Created June 18, 2020 18:15
Show Gist options
  • Save cgi-caesar/f1989d535635b38cadbdf08d5a68130c to your computer and use it in GitHub Desktop.
Save cgi-caesar/f1989d535635b38cadbdf08d5a68130c to your computer and use it in GitHub Desktop.
Widget Example Plugin
<?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