Future addButton() syntax – I need your suggestions

Monday, April 19th, 2010|Brainstorming, Version 3|by Romans|2 Comments

I’d like to hear your opinion about some suggestions towards button implementation

Currently there are 2 versions running around:

1) $form->addButton()->redirect(‘/’)  - in this one form’s addButton is returning $js(‘click’)->univ() of the button. This is backward compatible version and seriously, why would we need to do anything with button but redirect.

2) $form->addButton()->js(‘click’)->univ()->redirect(‘/’) – here addButton returns “View_Button” object. The benefit is that you can do certain things with is such as addLabel or setStyle(), which will affect how button looks. Also instead of just clicks you can use other events, such as mouse-over etc. This is more standard-compliant version IMHO

Read more

Tags: ,