You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have several form fields types that can be used in Xoops forms, but I think that the implementation could be better.
One change that could be very useful an productive for developers and designers is to add support for construct elements passing an array with all parameters.
newXoops\Form\Text(array(
'caption' => 'Field caption',
'name' => 'Field name',
'id' => 'Field ID',
'value' => 'Field value',
'data-something' => 'Some data for scripts like jQuery or Angular',
...
));
I think that this new way have several advantages over current one, specially when consider the creation of modules with more interactive and dynamic features, specially those that use intensively AJAX. Also this way allow a more flexible use of fields trough PHP, and allows to integrate perfectly with javascript. This can be very useful to create new fields (for example a extension that provide new field types) or apps.
Another advantage of this change is that we can maintain the backward compatibility. Existing modules still can use the current way, while new ones can implement the new form.
The text was updated successfully, but these errors were encountered:
Most of the attributes moved to an internal array already. There are a few exceptions, such as caption, value, and a few others, but it would be easy to consolidate everything for the definition phase.
I like the idea that an entire element could be defined in one call. This greatly simplifies defining a form.
Let me take a deeper look, but I think this would be quick and easy, and a great addition.
Currently we have several form fields types that can be used in Xoops forms, but I think that the implementation could be better.
One change that could be very useful an productive for developers and designers is to add support for construct elements passing an array with all parameters.
Consider the current way:
In addition, we could use:
I think that this new way have several advantages over current one, specially when consider the creation of modules with more interactive and dynamic features, specially those that use intensively AJAX. Also this way allow a more flexible use of fields trough PHP, and allows to integrate perfectly with javascript. This can be very useful to create new fields (for example a extension that provide new field types) or apps.
Another advantage of this change is that we can maintain the backward compatibility. Existing modules still can use the current way, while new ones can implement the new form.
The text was updated successfully, but these errors were encountered: