Skip to content

Class Box

ilham B edited this page Feb 10, 2024 · 1 revision

class Box

Box is an instance used for communication between instances in MerapiPanel, especially for modules. With a box, it allows for communication between modules.

Box::module

Module Service

Will return BoxModule represent module panel

Box::module("panel")

Get Module Service

Box::module("panel")->service();

Get Other Module Service

Box::module("panel")->service("Other");

Call Method Module

Will call method foo default service in module panel return array

// with param
Box::module("panel", [
   "foo" => [1, 2]
]);
// withou params
Box::module("panel", [
   "foo"
]);

Call Method in Other Service

will call Other or OtherService or ServiceOther in module panel and execute foo with parameters, return array

// with params     
Box::module("panel")->service("Other", [
   "foo" => [1, 2]
]);
// without params     
Box::module("panel")->service("Other", [
   "foo"
]);

Clone this wiki locally