mezon / gui
Small gui script
Installs: 5 128
Dependents: 2
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=7.2.0
- mezon/field: 1.1.*
- mezon/fields-set: 1.0.*
- mezon/functional: 1.1.*
- mezon/http-request-params: 1.0.*
- mezon/infrastructure-layer: 1.2.*
- mezon/list-builder-adapter: 1.1.*
- mezon/security: 1.1.*
- mezon/template-engine: 1.0.*
Requires (Dev)
- infection/infection: ^0.21.5
- phpunit/php-token-stream: 3.1.2
- phpunit/phpunit: ^8.5
- vimeo/psalm: ^4.2
This package is auto-updated.
Last update: 2024-10-15 22:27:25 UTC
README
Intro
Mezon provides set of classes for GUI creation.
Installation
Just print in console
composer require mezon/gui
And that's all )
Usage
DateTimeUtils class
This class provides utilities for date and time tasks. For example this call:
Mezon\Class\DateTimeUtils::isToday('2020-02-02');
Will return true if the passed date is a today and false otherwise.
And this method will return true if the passed date was a yesterday:
Mezon\Class\DateTimeUtils::isYesterday('2020-02-02');
But we also can get name of the month by it's code:
Mezon\Class\DateTimeUtils::locale = 'ru'; var_dump(Mezon\Class\DateTimeUtils::dayMonth('2020-02-02'));
Fields algorithms
This class provides routines for operation with form fields. To init this class use constructor:
$fields = new \Mezon\Gui\FieldsAlgorithms([ 'id'=>['type'=>'int'], 'description'=>['type'=>'string'] ]);
Here we define two fields.
Form builder
Form builder is obviously used for building forms )
It can be done like this:
$form = new \Mezon\Gui\FormBuilder([ 'id' => [ 'type' => 'int', 'title' => 'our entity's id' ], 'title' => [ 'type' => 'string', 'title' => 'our entity's title' ] ]);