Skip to content

feature request : need support the formBuilder functionality of yii #12

Closed
yiqing-95 opened this Issue Oct 4, 2012 · 7 comments

3 participants

@yiqing-95

the original yii formbuilder functionality use the CActiveForm . if we want change it to another one just specify the activeForm property of CForm . i v tried the original yii-bootstrap extension but it will display a ugly form to me , and i do post a feature request to chris83 . seems that he don't have too much time to do this . so i post the feature request here again , hope this feature will be accomplished !

      thanks for your great working  , this one is really nice as the yii-bootstrap is 
@tonydspaniard

One of the features was in fact to create automatic form displays for simple Models in TbGridView (the typical "add button") and one of the thoughts were to use CForm configuration for that. So I'll try to add it asap...

Would be nice if you could also propose something on the *-wip branch... Thanks for your words

@tonydspaniard tonydspaniard was assigned Oct 6, 2012
@yii-joblo

Formbuilder support is important for me too.

First I tried the direct way using the widgets, but detected the problem of the 'type' attribute of a 'TbInput' in a config array:

'elements' => array(
                    'myTextField'=>array(
                    'type'=>'bootstrap.widgets.input.TbHorizontalInput',
                    'type'=>'textfield', //<------------ problem double 'type' keys
                    'model'=>..,
                    'attribute'=>..,
                ),
            ),

Another solution can be a custom CForm and override render(), renderBody(), renderLabel() ...

@tonydspaniard

I think yii-joblo has a point here... maybe is better to create a TbForm to handle those issues and implement the different types of elements that YiiBooster has should be the solution

@yii-joblo

A 'TbForm extends CForm' is the only solution, the 'type'=>'...inputwidget ...' will never work.

I have detected another problem to:
A 'TbInput' needs a 'form' instance of the type 'TbActiveForm' on init().
So I have to additionally assign a ready created 'form'=>... in the elements-array.

But when using the formbuilder I want a 'CForm' and a CActiveForm and CForm is not compatible ...: if($form->submitted() ..., $form->validate() ...)

@yii-joblo

I have implemented the support for the formbuilder (new components TbForm, TbFormInputElement).
I will upload it to my fork in a few days.

@yii-joblo

Uploaded and added a pull request.

@tonydspaniard

done by yii-joblo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.