In a standard installation of Joomla! we have several predefined Menu events which, when triggered, call functions in the associated plugins.



Allows plugins to dynamically add menu types in the menu manager


  • &list A reference to the object that holds all the menu types
  • MenusModelMenutypes The model instance. This is in order for functions to add their custom types to the reverse lookup (in addition to adding them in the list property) via the addReverseLookupUrl function in the model.

Example Usage

Inside your system plugin the following code will add a custom menu type:

    public function onAfterGetMenuTypeOptions(&$list, MenusModelMenutypes $model)
        // Create a new Menu Type
        // Create the menu option for the component.
        $o = new JObject;
        $o->title       = 'Your Menu Type Title';
        $o->description = 'Your Menu Type Description';
        $o->request     =  [
            'option' => 'com_foobar',
            'other'  => 'option'
        $list['com_foobar'][] = $o;

Return Value

None. Result will be omitted.

Used in files


作者: 樱木花道



评论 (0)

  • 最新在前
  • 最佳在前