Yiibooster

Dear Antonio…

I was try TbBox and want to use it with renderPartial, but after i try… The content is not appear inside box but it’s appear outside the box…

could you show me where the problem is

This is my script…

$this->widget(‘bootstrap.widgets.TbBox’, array(

'title' => 'Basic Box',


'headerIcon' => 'icon-home',


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


));

Why use YiiBooster, web pages load too slowly? ???

By default, renderPartial is writing the code directly to the output. In your case before the TbBox is rendered.

You either have to tell renderPartial to return a string value…


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

… or make sure the opening div tag of TbBox is added to the output first, then do the renderPartial, and finally close the div of TbBox…




$this->beginWidget('bootstrap.widgets.TbBox', array(

    'title' => 'Basic Box',

    'headerIcon' => 'icon-home',

)); 

echo $this->renderPartial('_form', array('model'=>$model));

$this->endWidget();



Awesome don…

It works perfectly on my app.

Thx for your assist.

Next version will include TbResponsiveGridView which will work as the Zurb tables (having left side column fixed and the others scrollable). The one that you proposed works with media queries and I am not sure if we should create those queries automatically and register them… what do you guys think?

They should not be that slow (after you register your assets the first time)… maybe there is another missconfiguration?

Cheers

The problem is that your renderPartial is not RETURNING the code but rendering immediately. Do the following:




$this->widget('bootstrap.widgets.TbBox', array(

    'title' => 'Basic Box',

    'headerIcon' => 'icon-home',

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

    ));



Should work

Hi, Antonio.

About the Extended Grid Filters bug, just check the “Fixed header with filter” example at clevertech page. It’s not working there.

Regards!

Hi, thank you very much for this extension.

However, I’m worried about the performance drop that I experimented after changing from yii-bootstrap to yiiboster. On my local development environment Firebug is reporting 1.64 s to load a page with a 5-row TbGridView, which is compared to 844 ms using yii-bootstrap.

Have you tested performance? Do you consider this difference to be normal? I’m not worried about the numbers, but the application now “feels” slow :confused:

Is not working because it is not coded to work on the server

Have you test it after subsequent calls and make sure the library is not re-registering the assets?

Obviously the library takes more time to register the assets because it is much bigger… Please, check the website: http://yii-booster.clevertech.biz is it slow?

And if you are just using TbGridView the rendering is actually the same… please, make sure you do not re-register the assets per page reload.

We do use YiiBooster in all our projects and we have no issues at all.

Thanks for your reply!

The YiiBooster website doesn’t feel slow at all to me. It loads pretty quickly.

How can I check that the library is not "re-registering" the assets per page reload?

Please see this screenshot: http://i.imgur.com/6WWxR.png

I am testing the same project and page. The only difference between the two results is the extension being used. Tests on other pages have similar results.

My local development environment might not be resource powerful, and I know that on a live server it may not be so noticeable, but I’m wondering about this performance difference in terms of proportions… is it normal that YiiBooster seems to take more than double of time to load the exact same page than yii-bootstrap?

Hi Antonio…

I want to ask you more about TbCollapse.

I had try TbCollapse on Firefox browser and Opera broser, it goes fine with all that browser.

But when i try it on Chrome browser, the widget is floating on my header menu…

You can check it on

Thanks for the answer.

Please, check the following function on the bootstrap/components/Bootstrap component:




/**

	 * Returns the URL to the published assets folder.

	 * @return string the URL

	 */

	public function getAssetsUrl()

	{

		if (isset($this->_assetsUrl))

			return $this->_assetsUrl;

		else

		{

			$assetsPath = Yii::getPathOfAlias('bootstrap.assets');

			$assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG); // <----- Your YII_DEBUG is telling whether to forceCopy or not

			return $this->_assetsUrl = $assetsUrl;

		}

	}



Again, takes more time, because during development the assets are copied again and again, and this library is already huge. Afterwards, would be according to your use of the widgets and components taking into account that some of the objects may take a bit more time to load as there is more code to interpret.

I think you are missing the


margin-bottom: 40px

required on your body as stated on the bootstrap site when using fixed types of nav-bars.

Antonio,

The code I am using is from the Gii Bootstrap Generator. I have made no changes to the yii-booster css, etc.

I have a TBActiveform containing multiple elements and I want to replace the Check boxes with Toggle Buttons (but the code below only show the two check boxes I would like to appear on a single row)




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

	'id'=>'hosttemplate-form',

	'enableAjaxValidation'=>false,

        'type'=>'horizontal',

    'htmlOptions'=>array('class'=>'well span10'),

)); ?>


	<p class="help-block">Fields with <span class="required">*</span> are required.</p>


	<?php echo $form->errorSummary($model); ?>

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

        <?php echo $form->toggleButtonRow($model,'activeChecksEnabled');?>

        <?php echo $form->toggleButtonRow($model,'passiveChecksEnabled');?>


	<div class="form-actions">

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

			'buttonType'=>'submit',

			'type'=>'primary',

			'label'=>$model->isNewRecord ? 'Create' : 'Save',

		)); ?>

	</div>


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

Here is the current layout and what I wish to acheive. Any help gratefully received

3410

ToggleButtons.PNG

Regards

David

Thank you very much, Antonio.

I appreciate that you pointed me out that function where the forceCopy property was dependent on the YII_DEBUG parameter. I read the Yii documentation and now I understand better the behavior.

Setting forceCopy to false speeds up the application performance.

Now I’m a new and happy YiiBooster user. :)

Instead of using the form’s toggleButtonRow method use the TbToggleButton widget directly (check the TbInputHorizontal or TbInputVertical for its use), then wrap the two widgets within a '<div class=“control-group”> … widgets here (you may have to style them up yourself… ‘</div>’. It is a CInputWidget extended class so you can also use $model with it but you will have to prepend the labels.

Hint:




<div class="control-group ">

     <span class="pull-left"><label class="control-label" for="TestForm_toggle">Toggle Button</label><div class="controls">... WIDGET HERE... </div></span>

     <span class="pull-left"><label class="control-label" for="TestForm_toggle">Toggle Button</label><div class="controls">... WIDGET HERE... </div></span>

</div>


Attached the prove of concept