Skip to content
Elysio Martins edited this page Nov 4, 2023 · 4 revisions

wiki_logo

Introduction

Welcome to the EasyUIBuilder project wiki. This wiki provides in-depth information on how to use, configure, and extend the EasyUIBuilder project, a PHP library for creating user interfaces.

installation

git clone https://github.com/GoldRush-developpement/EasyUIBuilder
cd EasyUIBuilder/

start

  1. create root file in refaltor/roots/

root example

<?php

namespace refaltor\roots;

use refaltor\ui\builders\Root;
use refaltor\ui\builders\RootBuild;
use refaltor\ui\colors\BasicColor;
use refaltor\ui\elements\Label;

class LabelTest implements RootBuild
{

    public function root(): Root
    {
        # create root instance
        $root = Root::create();


        # create my element
        $label = Label::create("label_test", "Hello EasyUIBuilder !")
            ->setFontType(Label::TYPE_MINECRAFT_TEN)
            ->setFontSize(Label::FONT_EXTRA_LARGE)
            ->setColor(BasicColor::blue())
            ->setShadow();


        # add element in root instance
        $root->addElement($label);

        # return root instance
        return $root;
    }

    public function getNamespace(): string
    {
        return "ui_test";
    }

    public function getPathName(): string
    {
        return "./resources/test_ui.json";
    }
}
  1. register root file in refaltor/ui/Entry.php il startingService() function

register example

<?php

namespace refaltor\ui;


use refaltor\roots\LabelTest;
use refaltor\ui\builders\RootBuild;
use refaltor\ui\helpers\RegisterHelper;

class Entry extends RegisterHelper
{
    public function startingService(): void {


        # register root ui
        $this->register(new LabelTest());
    }
}
  1. start generation of your uis with the start.cmd or php start.php
Clone this wiki locally