Download the PHP package jbzoo/simpletypes without Composer
On this page you can find all versions of the php package jbzoo/simpletypes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package simpletypes
JBZoo / SimpleTypes
The universal PHP library to convert any values and measures - money, weight, currency coverter, length and what ever you want ;)
Installation
Examples
A lot of types are ready to use
SimpleTypes has such ready configurations like
- Area
- Degree (geometry)
- Info (bytes, bits...)
- Length
- Money (Currency converter)
- Temperature (Kelvin, Fahrenheit, Celsius and etc)
- Volume
- Weight
You can add your own type. It's really easy. See this page below.
Smart and useful parser
SimpleTypes has really smart parser for all input values. It can find number, understand any decimal symbols, trim, letter cases, e.t.c... and it works really fast!
Chaining method calls
Basic arithmetic
Different ways to use basic arithmetic
SimpleTypes can
- add
- subtract
- division
- multiply
- use custom functions (Closure)
- negative / positibe / invert sign / abs
- use percent
- setting empty value
- setting another value and rule
- create clone
- converting to any rules (currencies, units)
- rounding
- comparing
- ... and others
Compare values
And same examples but we will use smart parser
Percent method
Simple way for count difference between two values
PHP magic methods
Safe serialize/unserialize
__toString() works like text() method
__invoke()
Different ways for output and rendering
Only text
Simple HTML rendering
Output (warping added just for clarity)
HTML Input type[text]
Output (warping added just for clarity)
Notice: Yes, we added a lot of data-attributes in the HTML code. It will be useful for JavaScript and converting without reload a page.
Configuration of type
All configuration classes should be extended from Config class For example, config for information
Usage example for our information type
Output
Debug information
Show list of all actions with object. For example, this is history for chaining code
Show real inner data without any formating and rounding. ID is unique number for SimpleType objects.
Get object id
Show current value
Show current rule
License
MIT