[EXTENSION] Bootstrap

hi all. i’m sorry this lines:




Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');   return array(     'theme'=>'bootstrap', // requires you to copy the theme under your themes directory     'modules'=>array(         'gii'=>array(             'generatorPaths'=>array(                 'bootstrap.gii',             ),         ),     ),     'components'=>array(         'bootstrap'=>array(             'class'=>'bootstrap.components.Bootstrap',         ),     ), ); 



http://www.cniska.net/yii-bootstrap/setup.html

must be append which file? append line to controller or config?




Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');   return array(     'theme'=>'bootstrap', // requires you to copy the theme under your themes directory     'modules'=>array(         'gii'=>array(             'generatorPaths'=>array(                 'bootstrap.gii',             ),         ),     ),     'components'=>array(         'bootstrap'=>array(             'class'=>'bootstrap.components.Bootstrap',         ),     ), ); 



http://www.cniska.net/yii-bootstrap/setup.html

must be append in which file? append line to controller or config?

[/quote]

Answer: config file.

Hi Chris,

First of all, thanks for your efforts.

I have a couple of questions.

  1. While Bootstrap does a fantastic job out of the box, for certain aspects, I would need to either customise it or perhaps, buy a professional theme. How easy is it to use a custom theme with Yii-bootstrap?

  2. I am working on a new project where I am hoping to use Yii-bootstrap. Are there any set of steps that I need to take?

  3. Is there anything I need to be aware of?

And a few off-topic things:

  1. How well does Yii-bootstrap work with jQuery Datatables?

  2. How can I plug in jQuery Form Validator with Yii-bootstrap?

Best Regards,

Ashish.

Hi Guys,

awesome extension!

can you please help me with this:

http://www.cniska.net/yii-bootstrap/#tbNavbar Content section is too close to the navbar. The "Welcome to…" title is a little bit merged into (or rather slipped under) the navbar. How can I adjust this?

and how can I make ‘active’ property appear properly? I mean, it’s now hardcoded in the example, right? how can I make it dynamic, to be active depending on what page is actually loaded?

thanks a lot!

BR

c

how can i use bootstrap.widgets.TbModal to open a module/view/id in link.

my code is something like this

$columns = array(

				array(            // display 'create_time' using an expression


						'name'=>'ons_id',


						'type'=>'raw',


						'value'=>'CHtml::link($data->ons_id,"",array("href"=>\'index.php/onsLog/view/\'.$data->ons_id.\'\', "data-toggle"=>"modal" ))',


				),

where on click of link the popup should get open and view should be displayed in popup.

thanks in advance

i want to use menu bar of bootstrap in dynamic way,for example:

how can i use a loop for example foreach in an array like:

array(foreach(…),)…

i know that it isn’t correct to use foreach in array but i want to help me to know a way to do somthing like that

i want to create an array for items property of TbMenu widget.

Hi All,

I used TbModal to create a new record. One of the field is date. I used bootstrap-datepicker for the date. My problem is that the format is not applied when the field is didplayed using TbModal. However, it works ok when we use normal page.

Below is my javascript to display modal and add datepicker capability:




function createPaymentForm() {

        $.getJSON("<?php echo Yii::app()->createUrl('/salesPayment/load', array('id' => 0, 'salesFk' => $model->id)); ?>",

                function(data) {

                    $('#modalHeader').html('Tambah pembayaran');

                    $('#modalContent').html(data.formModal);

                    $('#sales-payment-form').attr('action', data.url);

                    $('#mySubmitButton').html('Tambah');

                    $('#mySubmitButton').attr('onClick', '{submitPaymentForm(); return false;}');

                    $('#modal').modal('show');

                    $('#SalesPayment_date').datepicker({format: 'dd-mm-yyyy', autoclose: true});

                });

    }



Can anyone help?

Kind regards,

Daniel

Daniel,

I am trying to achieve the same thing however, I can not get it to work. I am new to Yii and there just doesnt seem to be any tutorials for tbModal. Could you post how you created a model with the tbModal widget?

hi…

i have some problem when using CLEditor with bootstrap installed.

the CLEditor became a default textarea.

Are there any setting i’ve miss?

Thanks anyway

Thanks to the talented, friendly, and helpful people

Hey Chris,

Thanks for the nice extension.:)

Could you please help my out to configure Gii module with your extension.since i am unable to configure it with your mention configuration in document for this extension.

Looking forward to hear from you.

Thanks in Advance.

Thanks and Regards,

Ok,

So i have resolved that error. :) Looking forward to dig into in it more.

Thanks again for awesome extension.

Today I updated to the Version 2.1.0 and I had the problem that bootstrap didn’t load as expected. When googling the problem I found out, that more people had this problem. A solution that worked for me can be found here:

http://stackoverflow.com/a/15128829/720508

So also my question: Why is that not mentioned in the installation guide, or am I doing something wrong?

Can someone clarify that for me?

Thx!

Edit: Seems like that with the procedure you can include bootstrap only where you need it. Still without clarifying it, it is a bit confusing ;)

Hello everyone!

I’m using this AWESOME extension and I was wondering: how can I get a footer like the one in the Bootstrap oficial page??

Thanks in advance.


<footer class="footer">

  	<div class="container">

    	<p>Designed and built with all the love in the world by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>.</p>

    	<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>

    	<p><a href="http://glyphicons.com">Glyphicons Free</a> licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>

    	<ul class="footer-links">

      	<li><a href="http://blog.getbootstrap.com">Blog</a></li>

      	<li class="muted">·</li>

      	<li><a href="https://github.com/twitter/bootstrap/issues?state=open">Issues</a></li>

      	<li class="muted">·</li>

      	<li><a href="https://github.com/twitter/bootstrap/blob/master/CHANGELOG.md">Changelog</a></li>

    	</ul>

  	</div>

	</footer>




footer {

	text-align: center;

	padding: 30px 0px;

	margin-top: 70px;

	border-top: 1px solid rgb(229, 229, 229);

	background-color: rgb(245, 245, 245);

}



Thanks, Jacmoe!

Suppose we have:

  • ‘updatePassword.php’ <-- a form with password, newPassword and newPasswordRepeat fields

  • ‘updateEmail.php’ <----- a form with password and email fields

  • ‘update.php’ <---------- view with a TbTabs widget with the following code:




<?php $this->widget('bootstrap.widgets.TbTabs', array(

    'tabs'=>array(

        array(

            'id'=>'tab1',

            'active'=>true,

            'label'=>'Actualizar Dirección Email',

            'content'=>$this->renderPartial('/site/index', array('model'=>$model),true)

        ),

        array(

            'id'=>'tab2',

            'active'=>false,

            'label'=>'Actualizar Clave',

            'content'=>$this->renderPartial('updatePassword', array('model'=>$model),true)

        ),

    ),

)); ?>



The code in updatePassword (updateEmail is similar) is:




<div class="form">

    <?php /** @var BootActiveForm $form */

    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(

        'id'=>'horizontalForm',

        'type'=>'horizontal',

        'enableClientValidation'=>true,

        'clientOptions'=>array(

            'validateOnSubmit'=>true,

        ),

    )); ?>

    <p class="note">Los campos marcados con <span class="required">*</span> son obligatorios.</p>

    <br/>

    <fieldset>

        <?php echo $form->passwordFieldRow($model, 'password', array('class'=>'span3', 'value'=>'','labelOptions'=>array('label'=>'Clave Anterior'))); ?>

        <?php echo $form->passwordFieldRow($model, 'passwordNew', array('class'=>'span3', 'value'=>'','labelOptions'=>array('label'=>'Clave Nueva'))); ?>

        <?php echo $form->passwordFieldRow($model, 'passwordNewRepeat', array('class'=>'span3', 'value'=>'','labelOptions'=>array('label'=>'Repita la Clave Nueva'))); ?>

    </fieldset>


    <div class="form-actions">

        <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType'=>'submit', 'type'=>'primary', 'label'=>'Guardar')); ?>

        <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType'=>'reset', 'label'=>'Borrar')); ?>

    </div>


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


</div><!-- form -->



Also we have the corresponding actions in UserController, actionUpdatePassword and actionUpdateEmail.

My problem is that I don’t know how to call the right action inside actionUpdate after the user clicked on ‘Submit’.

How can I get this to work? Am I clear enough?

Thanks in advance.

Can i know how to reduce width and how to change background color in boot strap extension. i’m using this awesome extension.

I suppose:




if (isset($_POST['horizontalForm'])) {

            $model->setAttributes($_POST['horizontalForm']);


            if ($model->save()) {

                if (Yii::app()->getRequest()->getIsAjaxRequest())

                    Yii::app()->end();

                else

                    $this->redirect(array('admin'));

            }

        }



Hi,

Is it possible to add form elements without passing a CModel object?

Currently all bootstrap calls seems to be calling activeDropDownList() instead of dropDownList().

Thanks in advance

A.Miguel