Unify Control readOnly property case to camelCase#1810
Conversation
|
@mkrecek234 what is your opinion on |
|
@mvorisek you can argue that "readonly" is common for many languages, but many languages don't camelCase. Thus, I clearly prefer the camelCase as it is according to the rules. In English, proper writing is "read-only", which also supports to camelCase it. Any other opinion @abbadon1334 @ibelar ? Not a major topic, but let's make ATK4 even more beautiful ;-) |
src/Form/Control/Dropdown.php
Outdated
| 'id' => $this->name . '_input', | ||
| 'value' => $this->getValue(), | ||
| 'readonly' => $this->readonly ? 'readonly' : false, | ||
| 'readOnly' => $this->readOnly ? 'readonly' : false, |
There was a problem hiding this comment.
this is definitely wrong, readonly is canonical form of HTML attribute
In atk4/* the camelCase naming is defined by the "most natural snake_case". Both "read_only" and "readonly" variants make sense (vs. "checkbox", almost noone would write "check_box"). I have done more reseach on "readonly" vs "readOnly" with Google. When I was renaming the property in atk4/data, I did not think much of it and simply converted the snake_case to camelCase. The case used in other projects in quite mixed, LC is used mainly when it is a "language attribute" which is almost always LC (case insensitive) only. When used as a property name, they are projects which use it like proposed. To unify the naming with atk4/data (atk4 ecosystem in general), I am ok with this change. |
change readonly to readOnly