Hello,
I'm a one year old symfony user.
Lately, I've spend a lot of time with the new form system, writing an
invoice web application http://freelancerapp.fr/light (in french,
still in instable beta).
Html classes have a critical importance for front-end developpers.
They use them for both css and javascript. Actually, I didn't found
any clean way to add a class to a symfony widget without redefining
the whole class attribut.
The class can be changed at many different levels, so you might want
to add a class to an element without clearing the previously defined
ones.
For these cases, an addClass($class) method that adds the specified
class(es) to the widget could be very usefull.
Yes, but designers shouldn't use a method like addClass() in
templates. Instead, the parameters of render() and renderRow() have
been set up for them.
example: $form['name']->renderRow(array('class' => 'first')); // Reset
the html class and set it to first
We could also add "addClass" has an avaible attribute :
example: $form['name']->renderRow(array('addClass' => 'first')); //
Add "first" to the html class
If you like the concept, we could also add other method that could
improve the flexibility of the manipulations :
- hasClass($class) // Returns true if the specified class is present
on at least one of the set of the widget
- removeClass($class) // Removes all or the specified class(es) from
the set of the widget.
- toggleClass($class) // Adds the specified class if it is not
present, removes the specified class if it is present.
- toggleClass($class, $condition) // Adds the specified class if the
switch is true, removes the specified class if the switch is false.
These methods come from jQuery, so they will look pretty familiar to
many front-end developers :)
http://docs.jquery.com/Attributes
Best regards, I hope it's the right place to post this kind of
suggestions
Eric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---