Skip to content

This is a template for ILIAS REST Plugin extension developers.

License

Notifications You must be signed in to change notification settings

disc5/RESTPluginTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

RestPluginTemplate

This is a template extension for the ILIAS REST Plugin.

This extension can be used as a starting point for developing new extensions.

Features:

It provides exemplary routes to create, read, update and delete simple "items" (CRUD).

Requirements:

Note: If you actually want to make REST calls against the endpoints of this extension, you need to create the following database table.

CREATE TABLE IF NOT EXISTS `dev_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(1000) NOT NULL,
  `description` varchar(1024) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

You need to install the ILIAS REST Plugin first at your ILIAS installation. Then, as any other extension, you need to copy the folder "template" to the extensions folder of the plugin (i.e. Rest/RESTController/extensions/template).

You can test the template extension by using the command line tool "cURL". You should retrieve the content of the table dev_items.

curl -X GET http://localhost/restplugin.php/template/items

Notes:

As you might have read in the tutorial, the application logic is located in the model classes. In this example template, database accesses are realized via the ILIAS db abstraction class in its model. Of course other scenarios are possible and even more likely, e.g. dealing with ILIAS objects directly instead of accessing single database tables.

It is probably easier at the beginning not to secure the routes under development, but it should be kept in mind, that some kind of access control should be provided at the end (see tutorial).

About

This is a template for ILIAS REST Plugin extension developers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages