Jump to content

Developer Documentation

core/ModCp

What it is

ModCp extensions allow you to add new pages to the moderator control panel (ModeratorCP) on the front end. This can be beneficial if there are special areas of your application that moderators may need to handle, for example banning users from a chat room or allowing moderators to process form submissions in your application.

How to use it

The extension defines two basic methods.

    /**
     * Returns the primary tab key for the navigation bar
     *
     * @return    string|null
     */
    public function getTab()
    {
    }

The getTab() method returns a key for the navigation bar on the left hand side of the ModeratorCP. You will then need to define a language key with prefix modcp_ and the rest of the language key being the value returned by getTab() to represent the title of the tab in the ModeratorCP.

    /**
     * Manage
     *
     * @return    void
     */
    public function manage()
    {
    }

The manage() method is expected to return the tab HTML. The HTML returned will naturally vary depending upon the intention and functionality of the extension itself.

 

Additional Steps

After creating the extension, you'll also need to register the friendly URL definition ( modcp_$extensionName ) in your applications furl.json file! 


  Report Document


×
×
  • Create New...