Skip to content

ehamrin/cmsPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmsPlugin

##Create a plugin

  1. Choose a plugin name (referenced here as "{plugin}")
  2. Create directory {plugin} in /src/plugin/
  3. Name class and file {plugin} in /src/plugin/{plugin}/
  4. Make sure the class implements the \IPlugin interface
  5. If you want it to be able to hook to the admin panel, also implement \plugin\Admin\IAdminPanel

###Hook to public cms url

  1. create public function HookRootAccess($method){}
  2. The method should return true if the requested url is implemented in the plugin
/**
* @return bool
*/
public function HookRootAccess($method){
  return strtolower($method) == 'yoururl';
}

###Create admin panel menu

/**
* @return \NavigationItem[]
*/
public function HookAdminItems() 
{
  return array(
    new \NavigationItem(...)
  );
}

###Add user permission

/**
* @return \plugin\Authentication\model\Permission[]
*/
public function HookUserPermissions() 
{
  return array(
    new \plugin\Authentication\model\Permission(...)
  );
}

About

First commit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published