Download the PHP package wheregroup/joii without Composer
On this page you can find all versions of the php package wheregroup/joii. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wheregroup/joii
More information about wheregroup/joii
Files in wheregroup/joii
Package joii
Short Description Javascript Object Inheritance Implementation
License MIT
Homepage http://joii.harold.info
Informations about the package joii
What is JOII?
JOII (short for JavaScript Object Inheritance Implementation) brings class- based programming to JavaScript without the use of a compiler. Everything is done using native JavaScript. JOII allows you to build your applications using Classes and Interfaces as you would in most other object oriented languages. JOII is built with the priciple of being compatible with any browser on the market. Therefore, JOII is supported by Internet Explorer 5.5 and anything that came after that.
Full documentation can be found here
Features
- Support Internet Explorer 5.5 and up
- Build and extend on classes
- Support for interfaces
- Strong typehinting in class properties
- Typehinting for custom object definitions
- Visibility setting (public, protected)
- Final & abstract properties and methods
- Traits / Mix-ins
- Enums
- Reflection
- (since 3.1.0) Custom constructor and callable method names
License
Like most other popular JavaScript libraries, JOII is released under the MIT license.
The MIT License is simple and easy to understand and it places almost no restrictions on what you can do with a JOII project. You are free to use any JOII-project in any other project (even commercial projects) as long as the copyright header is left intact. All sample codes on this website are public domain, meaning you're free to do with them as you please.
Installation
Browser
Load JOII like any other library. JOII does not require any dependencies.
JOII is available as a bower package:
bower install joii
Node
Install using npm and automatically add to your package.json file using --save
if you want.
Somewhere, in your node project:
Running unit tests
- Clone the repository from here.
- Install dependencies through npm via
npm install
- Run the testsuite using the command
npm test
- Optionally, open
testsuite.html
in a browser to see the browser-version of the unit tests.
Sneak peek
This is an example of what JOII looks like in action.
As you can see, the example code uses setter and getter methods that we didn't define. When a property is declared public, JOII automatically generates getters and setters for this property and enforces type checking in them.
Properties are not exposed to the public, even if they are declared to be.
When a property is declared protected, getters and setters are still generated but are not exposed to the public. When a property is declared private, nothing is generated.
Find out more about this in the getters and setters section.
Custom constructor methods
As of 3.1.0, it's possible to add custom constructor methods. To ensure full compatibility with other JOII-based libraries, constructor method names are only added and never replaced. When a constructor method is found, no more of these will be executed upon instantiation.
You can add custom constructor method names using JOII.Config.addConstructor('hello');
For example:
Beware that original / existing constructors are leading, meaning they'll be executed first.