Skip to content
This repository has been archived by the owner on Feb 2, 2018. It is now read-only.

This module contains all files and folder to begin the developpment of new module

License

Notifications You must be signed in to change notification settings

Piou-piou/ribs-module-starter-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ribs-module-starter-dev

AGPL License

This module contains all files and folder to begin the developpment of a module

Download This starter dev

You can install it with composer with this command :

$ composer create-project piou-piou/ribs-module-starter-dev your_module

Before install it, you must be in modules folder of your ribs project

Base folders and files

  • admin : contain all files wich be used in administrator part
  • app : contain all fils wich be used in app view
  • router : contain routes file for admin and app. It contains a config.php file to put constant in it if it is necessary.
  • install.php contain only one variable, in it put you sql requesto to create all tables for your module
  • uninstall.php contain only one variable, in it put you sql requesto to delete all tables for your module
  • composer.json wich is created by composer on install

Admin folders and files

  • controller : put in it all controllers and class files wich will be user in administrator
  • views : put in this folders all files for the view in administrator of your module
  • views/header.html contain the header that ribs use
  • views/index.html contain skeleton to begin a page in administration

App folders and files

  • controller : put in it all controllers and class files wich will be user in app
  • views : put in this folders all files for the view in app of your module
  • views/header.html can contain header of your module (could be deleted)
  • views/index.html contain skeleton to begin a page in app

Router folder files

  • routes.php and admin_routes.php : this files is called in index.php at the base of ribs in RouterModule class. In the first if :
if (\core\modules\GestionModule::getModuleActiver("your-module-name"))

you can call controller. this if check if you module is correctly activated in modul table.

To call a controller you have to use this code :

if ($this->page == "a-page") {
	\modules\your_module_folder\app\controller\MyModuleClass::$router_parameter = $this->parametre;
	$this->controller = "your_module_folder/app/controller/your_file.php";
}
  • "a-page" -> this is the name of the page that you call in url
  • the parameter is a paramter set in url (after last / in url)
  • $this->controller is the path where the controller you want, the base path of it is /modules/ Put the folder of you module and path in you module folder

Url construction

About

This module contains all files and folder to begin the developpment of new module

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published