Sign in Registration
ruen

.service

Table of contents

Files with the service extension are used for service purposes - to describe addresses in the system, api, database tables, and more. Almost every entity should have such files. An example of the exemplary contents of the entity.service file (where entity is the name of the entity):

namespace modules\entity;

class Service {
	public $routes = [
		// Your routes are here
	];

	public $api = [
		// Your api methods here
	];

	public $schema = [
		// Your database schema is here
	];

	function get_routes() {
		return $this->routes;
	}

	function get_api() {
		return $this->api;
	}

	function get_schema() {
		return $this->schema;
	}

	install() {
		// Actions during install
	}

	function uninstall() {
		// Actions during uninstall
	}

	enable() {
		// Actions during enable
	}

	disable() {
		// Actions during disable
	}
}

Latest articles

Popular sections

Eqsash (Tools)

Android app - VK LAST USER ID, отучитель от зависимости и т.д.:
Available on Google Play

Amessage (Communication)

Login to the web version
Android app:
Available on Google Play

Share this

Subscribe to

YouTube

Books

IT notes - In simple language about the most necessary things (HTML, CSS, JavaScript, PHP, databases, Drupal, Bitrix, SEO, domains, security and more), PDF, 500 p.