Yii Framework Forum: Yiibooster - Yii Framework Forum

Jump to content

  • (16 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • This topic is locked

Yiibooster Make it gorgeous. Do it Fast. Rate Topic: ***** 6 Votes

#61 User is offline   akurnia 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 07-October 12

Posted 30 October 2012 - 02:39 AM

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))
));
0

#62 User is offline   Aoseala 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 28-February 12

Posted 30 October 2012 - 03:12 AM

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

#63 User is offline   Don Felipe 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 117
  • Joined: 02-January 11
  • Location:Saigon, Vietnam

Posted 30 October 2012 - 03:32 AM

View Postakurnia, on 30 October 2012 - 02:39 AM, said:

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))
));


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();

0

#64 User is offline   akurnia 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 07-October 12

Posted 30 October 2012 - 03:40 AM

Awesome don...
It works perfectly on my app.
Thx for your assist.
0

#65 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 30 October 2012 - 01:13 PM

View Postnkd, on 29 October 2012 - 11:10 AM, said:

After some days of playing with yiibooster I have found that responsive design is great but does not work for grids. It would be awesome to have a responsive grid, something like the one in this page:

http://css-tricks.co.../responsive.php

I do not know if this same trick could work for the yii grid but maybe something similar can be done.

For now, to make the experience of the grids in tablets or phones a little better , I managed to make some columns disappear like this:

...

array(
  'name'=>'date_modified',
  'htmlOptions'=>array('class'=>'hidden-tablet hidden-phone'), 
  'headerHtmlOptions'=>array('class'=>'hidden-tablet hidden-phone'),
 'filterHtmlOptions'=>array('class'=>'hidden-tablet hidden-phone'),
),
...


Maybe someone is wondering why I used "hidden-tablet hidden-phone" instead of "visible-desktop." Well, for some reason if I use the visible-desktop the grid design breaks. The hidden class works OK.

Anyway, this option works for hiding columns but the one I am suggesting would work for having the same columns displayed vertically. Grids are very useful and if someone is using bootstrap it is very probable he/she wants compatibility with all mobile devices, so the responsive gris is a must!



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?
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#66 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 30 October 2012 - 01:14 PM

View PostAoseala, on 30 October 2012 - 03:12 AM, said:

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


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

Cheers
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#67 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 30 October 2012 - 01:16 PM

View Postakurnia, on 30 October 2012 - 02:39 AM, said:

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))
));


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
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#68 User is offline   jmariani 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 12-January 12

Posted 30 October 2012 - 04:03 PM

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!
0

#69 User is offline   tomsea 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 25-November 11

Posted 30 October 2012 - 04:44 PM

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 :/
0

#70 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 30 October 2012 - 05:45 PM

View Postjmariani, on 30 October 2012 - 04:03 PM, said:

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!


Is not working because it is not coded to work on the server
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#71 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 30 October 2012 - 05:50 PM

View Posttomsea, on 30 October 2012 - 04:44 PM, said:

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 :/


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.
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#72 User is offline   tomsea 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 25-November 11

Posted 30 October 2012 - 05:57 PM

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?
0

#73 User is offline   tomsea 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 25-November 11

Posted 30 October 2012 - 06:25 PM

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?
0

#74 User is offline   akurnia 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 07-October 12

Posted 31 October 2012 - 01:49 AM

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 Posted Image

Thanks for the answer.
0

#75 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 31 October 2012 - 03:40 AM

View Posttomsea, on 30 October 2012 - 05:57 PM, said:

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, 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;
		}
	}

¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
1

#76 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 31 October 2012 - 03:42 AM

View Posttomsea, on 30 October 2012 - 06:25 PM, said:

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?


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.
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#77 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 31 October 2012 - 03:43 AM

View Postakurnia, on 31 October 2012 - 01:49 AM, said:

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 Posted Image

Thanks for the answer.


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.
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#78 User is offline   David Walker 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 21-August 12

Posted 31 October 2012 - 08:11 AM

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

Attached File  ToggleButtons.PNG (37.25K)
Number of downloads: 95

Regards

David
0

#79 User is offline   tomsea 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 25-November 11

Posted 31 October 2012 - 10:12 AM

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.

Quote

forceCopy: whether we should copy the asset file or directory even if it is already published before. In case of publishing a directory old files will not be removed. This parameter is set true mainly during development stage when the original assets are being constantly changed. The consequence is that the performance is degraded, which is not a concern during development, however. Default value of this parameter is null meaning that it's value is controlled by $forceCopy class property.


Setting forceCopy to false speeds up the application performance.

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

#80 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 31 October 2012 - 01:08 PM

View PostDavid Walker, on 31 October 2012 - 08:11 AM, said:

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

Attachment ToggleButtons.PNG

Regards

David


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

Attached File(s)


¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

Share this topic:


  • (16 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • This topic is locked

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users