[EXTENSION] Bootstrap

Hey Daniel,

This is a know issues which was fixed in version 0.9.4. Please upgrade to fix this issue.

Chris!

I try to make my cmenu with dropdown, use menu as in bootstrap examples with that classes, but javascript doesn’t work. Did you use “bootstrap-dropdown.js” in this extension?

it works if i put bootstrap-dropdown.js for example in scripts directory and call <script src="/scripts/bootstrap-dropdown.js"/> in my layout. But think it’s not properly way…

anyone know?

Here are some samples for opening and closing the modal.




<a href="#" onclick="$('#modal').bootModal('open'); return false;">Open</a>






js:function() {

	$('#modal').bootModal('close');

	return false;

}



Assuming that ‘modal’ is your modal’s id.

I hope this helps.

Hey almix,

The menu widget is actually next on my TODO.

Version 0.9.5 is now live!

http://www.yiiframework.com/extension/bootstrap/files/bootstrap-0.9.5.zip

What’s new?

  • Added support for input lists

  • Combined BootTabs and BootPills to BootMenu

  • Moved all widgets under the same folder

  • Removed BootHtml

  • Renamed BootInputBlock to BootInput

  • Renamed the block methods in BootActiveForm to row

[i]Please note that from 0.9.5 forward BootInputBlock is called BootInput and all the "block" methods in BootActiveForm have been replaced with "row" methods, e.g. textFieldBlock is now called textFieldRow.

BootGridView has been moved into the widgets folder and BootTabs and BootPills have been combined into BootMenu. In addition to this BootHtml has been removed.[/i]

What’s next?

  • jQuery UI widget for BootMenu

  • BootTopbar

Where’s the LESS support?

I’m planning to release my LESS-extension soon which can be used together with Bootstrap to allow you to use all the mixins etc. Bootstrap provides.

Enjoy!

Chris83,

thank you!

now able to open and close the modal window.

one question, how do I get the fields and labels with the original formatting?

when I open the form with the fields are up and when the labels are displayed by the modal window the labels are beside the fields and the fields glued one after another.

Please provide me with a screenshot and I might be able to help.

2305

Sem título.png

Very nice update, thx.

hi ,

thanx for this great job , it’s a very useful extention.

My problem is that i have editet the less files and want to regenerate them but i can’t fo it with your extention. Can you please tel me how to do it ?

thank you very much

Hey,

Use the "row" methods to output the form fields, e.g.:




<?php $form->textFieldRow($model,'name',array('class'=>'span4')) ?>



Hey yiiesss,

You can do this using my LESS extension I released today:

http://www.yiiframework.com/extension/less/

Chris83,

the code with the fields of modal window is already so …




<?php $form=$this->beginWidget('ext.bootstrap.widgets.BootActiveForm',array(

	'id'=>'contatos-form',

        'stacked'=>true,

	'enableAjaxValidation'=>false,

)); ?>

<div class="hidden">

        <?php echo $form->textFieldRow($model,'id',array('class'=>'span5')); ?>


	<?php echo $form->textFieldRow($model,'data_cri',array('class'=>'span5')); ?>


	<?php echo $form->textFieldRow($model,'data_alt',array('class'=>'span5')); ?>


	<?php echo $form->textFieldRow($model,'criado_por',array('class'=>'span5','maxlength'=>20)); ?>


	<?php echo $form->textFieldRow($model,'alterado_por',array('class'=>'span5','maxlength'=>20)); ?>


	<?php echo $form->textFieldRow($model,'id_cliente',array('class'=>'span5')); ?>

</div>


	<?php echo $form->dropDownListRow($model,'tipo',array('Residencial'=>'Residencial', 'Comercial'=>'Comercial', 'Celular'=>'Celular', 'Rádio'=>'Rádio'),array('class'=>'span5','maxlength'=>30)); ?>


	<?php echo $form->textFieldRow($model,'ddd',array('class'=>'span5')); ?>


	<?php echo $form->textFieldRow($model,'numero',array('class'=>'span5')); ?>


<?php $this->endWidget(); ?>



seems greeat , tanks ;)

That’s weird because the form in your screenshot is not a stacked form. I can’t think of anything else right now but please let know what the problem was if you happen to solve this issue.

EDIT: I just thought of something, try adding a fieldset around your visible form rows and see if that helps.

Hey guys, please help me if you know

I try use CKkceditor for textArea, so i place such code:


<div class="row">

            <?php echo $form->labelEx($model,'content'); ?> 

            <?php //echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50));

                    $this->widget('application.extensions.editor.CKkceditor',array(

                                "model"=>$model,                # Data-Model

                                "attribute"=>'content',         # Attribute in the Data-Model

                                "height"=>'400px',

                                "width"=>'100%',

                                "filespath"=>(!$model->isNewRecord)?Yii::app()->basePath."/../media/paquetes/".$model->idpaquete."/":"",

                                "filesurl"=>(!$model->isNewRecord)?Yii::app()->baseUrl."/media/paquetes/".$model->idpaquete."/":"",

                                )

                            ); 

                ?>

            <?php echo $form->error($model,'content'); ?>

      </div> 

and need not to use textArea therefore, and lose label for ‘content’ and become out of bootstrap cool design…

are there any salvation to use textArea with CKkceditor extension inside?

may be something like this:


<?php echo $form->textAreaRow($model, 'content'=>array(

            'type'=>'application.extensions.editor.CKkceditor',

            

        ));

        ?>

Thank you!

Hey almix,

You cannot use textAreaRow in your case, please use CActiveForm::textArea instead and see the Bootstrap documentation about the formatting so that you can get the layout correct.

Hey @Chris83 — just wanted to drop by to say how much I appreciate your Bootstrap extension. Great stuff… it has saved me a bunch of time. Awesome! I’d have posted it to the extension page, but I’m too new. :slight_smile:

And now I see that you’ve made a LESS extension… thanks again! For anyone else out there using the Bootstrap extension, you might want to check out the LESS extension as well: http://www.yiiframework.com/extension/less/

Really liking the vibe here in the Yii community. Seems to be an unusual combination of talented, friendly, and helpful people. Some other frameworks I’ve used had a very different feel.

@joedwy: Thank you for the positive feedback. :) It always makes me smile when I hear that I have helped a fellow Yii developer. I agree that the atmosphere in the Yii community is better than most of the framework communities and I hope that we can improve it even further in the future.