Sapphire Documentation

Sapphire\Component\Component::class

class Component

use ComponentRenderer;

use ComponentEvents;


public static $OnyxCompiler - Contains OnxyCompiler agent to compile onyx components

protected string $component_id - Contains component id generated in constructor

protected string $component_folder - Contains path to component folder

public stdClass | array $params - Contains all component parameters


public function SetParams(stdClass | array $params): void - Set component params

public function SetComponentFolderPath(string $path): void - Set component folder path

public function Get(string $property) - Get class instance property

public function __construct() - Constructs object


trait ComponentEvents

public function Mounted(): void - This event is being triggered just before rendering component. It should be used to fetch data to show in component


trait ComponentRenderer

public function Render(stdClass | array $data = []): void - renders component