1
Mamba
XOOPS 2.6.0: Begin implementing arbitrary attribute support in form elements
  • 2014/8/12 19:54

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


If you don't follow the XOOPS 2.6.0 development on GitHub, this is the latest update from Richard:

Quote:
HTML5 introduced many new attributes, including custom data attributes. Also, some popular javascript libraries rely on the ability to include custom attributes. The only way available to add a new or nonstandard attribute in Xoops\Form\Element was the setExtra() method. Additionally, huge amounts of code exist within the form element render methods to perform the basic task of rendering attributes.

This change introduces the following Element methods:

setAttribute() - sets a named attribute
getAttribute() - get a named attribute
hasAttribute() - determine if an named attribute exists
addAttribute() - add to a multi-valued attribute, such as class
renderAttributeString() - render all attributes to a string
These methods provide a generic mechanism to introduce any attribute into a form element without additional coding or manual building of attribute strings.

For example:
$element->addAttribute('disabled');


At present, the base Element class is converted, along with Text and direct subclasses, Button, and TextArea. Additional conversion will follow.

We encourage everybody to open an account there, and then go to XOOPS 2.6.0 and click on the buttons:

- Watch
- Start

So you can get notified about all changes.

Also, please Fork the XOOPS 2.6.0 Core, so you can test the Core on your own, and then submit changes back to the Core Team.

If you need help in learning how to open an account on GitHub, and how to fork a repository, and how to submit changes, please let us know, and we'll be glad to help.
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

Login

Who's Online

183 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 183


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits