OOUI/PHP examples

There is a more extensive set of examples in the source code repository.

First, clone the repo and install it using composer, then have a look at.

If you wish to use the library in your project, run.

Creating a button
To create a button, use the  class. The first and only argument to a button's constructor is its configuration.

Before the button is converted to HTML and emitted, the label, target and href can be changed using the  and   methods.

The button is now created, and has a label which reads "Still click me!", but is not yet visible to the user, as it must first converted to HTML and echoed into the document: