diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-01-01 16:21:05 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-01-01 16:21:05 -0500 |
commit | 035c2107fdb266358ed218e6a3551e5cad39fe18 (patch) | |
tree | 7351f2b203f3059e4951c566ec563a1fe0b628f3 /documentation | |
parent | 43b4629f7e3d111f2c41ab0cdfd48b38c17db92c (diff) | |
download | elgg-035c2107fdb266358ed218e6a3551e5cad39fe18.tar.gz elgg-035c2107fdb266358ed218e6a3551e5cad39fe18.tar.bz2 |
Fixes #3225 added what was missing from the basic init function example
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/examples/plugins/start.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/documentation/examples/plugins/start.php b/documentation/examples/plugins/start.php index ea1e894b2..3af50ce38 100644 --- a/documentation/examples/plugins/start.php +++ b/documentation/examples/plugins/start.php @@ -8,5 +8,15 @@ elgg_register_event_handler('init', 'system', 'my_plugin_init'); function my_plugin_init() { // Rename this function based on the name of your plugin and update the // elgg_register_event_handler() call accordingly - + + // Register a script to handle (usually) a POST request (an action) + $base_dir = elgg_get_plugins_path() . 'my_plugin/actions/my_plugin'; + elgg_register_action('my_plugin', "$base_dir/my_action.php"); + + // Extend the main CSS file + elgg_extend_view('css/elgg', 'my_plugin/css'); + + // Add a menu item to the main site menu + $item = new ElggMenuItem('my_plugin', elgg_echo('my_plugin:menu'), 'my_url'); + elgg_register_menu_item('site', $item); } |