Yii Framework Forum: [EXTENSION] Bootstrap - Yii Framework Forum

Jump to content

  • (45 Pages)
  • +
  • « First
  • 15
  • 16
  • 17
  • 18
  • 19
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] Bootstrap Bringing together Yii and Twitter Bootstrap Rate Topic: ***** 23 Votes

#321 User is offline   Dyp2000 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 16-March 12

Posted 03 April 2012 - 10:30 PM

View Postsaska, on 02 April 2012 - 11:44 PM, said:

Yes, when i asked about confirmation dialog, i have same question had in mind: how make dialog confirmation in items link of BootButtonGroup?

+1
0

#322 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 04 April 2012 - 02:14 PM

@saska, Dyp2000: I'm not sure I understand what you mean... What do you mean by items? Dropdown?
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#323 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 04 April 2012 - 05:36 PM

I've released a BETA version of the upcoming version 0.9.11.

What's new?
  • Added BootLabel, BootBadge
  • BootTabbable improvements
  • BootButton, BootButtonGroup improvements
  • BootNavbar, BootMenu improvements
  • BootGridView, BootDetailView improvements
  • Fixed BootTabbable events
  • Added missing CSS for Yii components
  • Renamed BootButton::fn to buttonType (changed to be more Yii:ish, sorry for the inconvenience)

I was going to release version 1.0.0 next but it will be a bit delayed because I've been quite busy. However, many people has asked about the next release so I thought it would be good to do a release now.

You can download it here:
http://www.yiiframew...t/files/?id=642

Enjoy!
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#324 User is offline   saska 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 01-April 12

Posted 04 April 2012 - 10:48 PM

View PostChris83, on 04 April 2012 - 02:14 PM, said:

@saska, Dyp2000: I'm not sure I understand what you mean... What do you mean by items? Dropdown?

I want make confirmation dialog for item links inside drop down menu, i try make this:

<?php $this->widget('bootstrap.widgets.BootButtonGroup', array(
'type'=>'primary',
'buttons'=>array(
array('label'=>'Edit', 'url'=>array('update', 'id'=>$data->id)),
array('items'=>array(
array(
'label'=>'Deleteee1',
'url'=>array(
'item/delete',
'id'=>$data->id,
),
'htmlOptions'=>array(
'submit'=>array('item/delete', 'id'=>$data->id),
'confirm'=>'Are you sure?',
),
),
)),
),
)); ?>

but this not work, becouse Object BootButtonGroup not have reciedev properties 'htmlOptions' inside items.
I attach screenshot with link "Delete" wich need confirmation dialog.
Hope i make clearly this explain.

Attached File(s)


0

#325 User is offline   Coowboy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 04-April 12

Posted 04 April 2012 - 11:47 PM

I'm beginning with Yii starting yesterday. Can someone post the complete source code (view and controller) of the demo including the PHP and HTML files if any incl View and Controllers. I'm finding it very hard to understand how this extension will be used.

Quite naively maybe, if I put the following in a .php file and run it in a browser I get,


Fatal error: Using $this when not in object context in C:\Tools\xampp\htdocs\learning\testBS.php on line 1


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

0

#326 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 05 April 2012 - 01:21 AM

View Postsaska, on 04 April 2012 - 10:48 PM, said:

I want make confirmation dialog for item links inside drop down menu, i try make this:

<?php $this->widget('bootstrap.widgets.BootButtonGroup', array(
'type'=>'primary',
'buttons'=>array(
array('label'=>'Edit', 'url'=>array('update', 'id'=>$data->id)),
array('items'=>array(
array(
'label'=>'Deleteee1',
'url'=>array(
'item/delete',
'id'=>$data->id,
),
'htmlOptions'=>array(
'submit'=>array('item/delete', 'id'=>$data->id),
'confirm'=>'Are you sure?',
),
),
)),
),
)); ?>

but this not work, becouse Object BootButtonGroup not have reciedev properties 'htmlOptions' inside items.
I attach screenshot with link "Delete" wich need confirmation dialog.
Hope i make clearly this explain.

Alright saska,

Here's the solution:

<?php $this->widget('bootstrap.widgets.BootButtonGroup', array(
	'type'=>'primary',
	'buttons'=>array(
		array('label'=>'Edit', 'url'=>array('update', 'id'=>1)),
		array('items'=>array(
			array('label'=>'Delete', 'url'=>'#', 'linkOptions'=>array(
				'submit'=>array('item/delete', 'id'=>1),
				'confirm'=>'Are you sure?')
			),
		)),
	),
)); ?>

The problem was that you tried specifying htmlOptions for the dropdown link when infact itemOptions are the htmlOptions for the list item (li) and linkOptions are the htmlOptions for the link itself. Hope this helps, it worked for me at least.
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
1

#327 User is offline   saska 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 01-April 12

Posted 05 April 2012 - 01:57 AM

View PostChris83, on 05 April 2012 - 01:21 AM, said:

Alright saska,
Here's the solution:
...


Thank you!
0

#328 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 05 April 2012 - 02:35 AM

View PostCoowboy, on 04 April 2012 - 11:47 PM, said:

I'm beginning with Yii starting yesterday. Can someone post the complete source code (view and controller) of the demo including the PHP and HTML files if any incl View and Controllers. I'm finding it very hard to understand how this extension will be used.

Quite naively maybe, if I put the following in a .php file and run it in a browser I get,


Fatal error: Using $this when not in object context in C:\Tools\xampp\htdocs\learning\testBS.php on line 1


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


Hey Coowboy,

Seems that you haven't set up your Yii application properly. Please read the guides to learn Yii basics before you try to install any extensions.

I'd recommend you start by reading this:
The Definitive Guide to Yii
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#329 User is offline   Coowboy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 04-April 12

Posted 05 April 2012 - 09:13 AM

View PostChris83, on 05 April 2012 - 02:35 AM, said:

Hey Coowboy,

Seems that you haven't set up your Yii application properly. Please read the guides to learn Yii basics before you try to install any extensions.

I'd recommend you start by reading this:
The Definitive Guide to Yii


Chris83 - Thanks for the prompt reply. I have indeed setup Yii, created my first app and am able to do the first set of usual things as laid out in the guide. Would it be possible for you to zip up and provide the demo project including the app configuration files?
0

#330 User is offline   cyphos 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 13-March 12

Posted 06 April 2012 - 06:06 AM

hi Chris
i already extracted to extensions
and css not reload

mysterious!!!

View PostChris83, on 03 April 2012 - 02:35 PM, said:

You only need to extract the extension (preferably to extensions) and it will work.

0

#331 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 06 April 2012 - 10:47 AM

View Postcyphos, on 06 April 2012 - 06:06 AM, said:

hi Chris
i already extracted to extensions
and css not reload

mysterious!!!

Of course you also need to add bootstrap to your application config. You can read about setting up the extension here:
http://www.cniska.ne...trap/setup.html
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#332 User is offline   Neuni 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 07-April 12

Posted 07 April 2012 - 01:01 PM

Hi,

i followed the setup instructions at cniska.net/yii-bootstrap/setup.html (and added 'generatorPaths'=>array('bootstrap.gii'), to config/main.php)
Using
$this->widget('bootstrap.widgets.BootMenu', array(...
works well, but when I use gii to generate CRUD code, it still generates the normal code (e.g. admin.php still contains zii.widgets.grid.CGridView) instead of the code provided in extensions/bootstrap/gii/bootstrap/templates/default/.
Any idea whats wrong?

Latest version of yii, yii-bootstrap 0.9.11 beta.
0

#333 User is offline   Neuni 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 07-April 12

Posted 07 April 2012 - 02:00 PM

View PostNeuni, on 07 April 2012 - 01:01 PM, said:

Hi,

i followed the setup instructions at cniska.net/yii-bootstrap/setup.html (and added 'generatorPaths'=>array('bootstrap.gii'), to config/main.php)
Using
$this->widget('bootstrap.widgets.BootMenu', array(...
works well, but when I use gii to generate CRUD code, it still generates the normal code (e.g. admin.php still contains zii.widgets.grid.CGridView) instead of the code provided in extensions/bootstrap/gii/bootstrap/templates/default/.
Any idea whats wrong?

Latest version of yii, yii-bootstrap 0.9.11 beta.


Ok...my fault. Just saw that the bootstrap-CRUD-generator will not replace the yii-CRUD-generator. Used the "Bootstrap Generator" and everything works fine.
0

#334 User is offline   swampone 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 28-March 11

Posted 08 April 2012 - 11:12 AM

How to set the carousel to auto rotate once the page is loaded
'events'=>array(
                    'slide'=>"js:function() { console.log('Carousel slide.'); }",
                    'slid'=>"js:function() { console.log('Carousel slid.'); }",
                ),

1

#335 User is offline   Dyp2000 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 16-March 12

Posted 09 April 2012 - 10:01 PM

Please add the code to BootCarousel.php to draw custom html code. Like this:

protected function renderItems ($items)
....
if (isset($item['customHtml'])) {
    echo $item['customHtml'];
}
...
}

0

#336 User is offline   Dyp2000 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 16-March 12

Posted 10 April 2012 - 09:52 PM

View Postswampone, on 08 April 2012 - 11:12 AM, said:

How to set the carousel to auto rotate once the page is loaded
'events'=>array(
                    'slide'=>"js:function() { console.log('Carousel slide.'); }",
                    'slid'=>"js:function() { console.log('Carousel slid.'); }",
                ),



for autorotate carousel and correct handle 'options' do patch BootCarousel.php - public function run():

replace this
$cs->registerScript(__CLASS__.'#'.$id, "jQuery('{$id}').carousel({$options});");


to
$cs->registerScript(__CLASS__.'#'.$this->id, "jQuery('#{$id}').carousel({$options});");

0

#337 User is offline   klavan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 30-May 11

Posted 11 April 2012 - 07:46 AM

Great extension!!!

When I loaded the bootstrapper, my existing forms were transformed to the css of the bootstrap.
I don't really want that, it is possible to only apply the css to forms I indicate?
0

#338 User is offline   Fredi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 17-January 12

Posted 13 April 2012 - 01:59 AM

Hi ! This is really great extension, although icons in submit button doesn't work for me.

<?php $this->widget('bootstrap.widgets.BootButton', array('fn'=>'submit', 'type'=>'primary', 'icon'=>'ok white', 'label'=>'Submit')); ?>


Result:
<input class="btn btn-primary" type="submit" name="yt1" value="&lt;i class=&quot;icon-ok icon-white&quot;&gt;&lt;/i&gt; Submit">

0

#339 User is offline   zebra 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 46
  • Joined: 04-March 12

Posted 13 April 2012 - 04:32 AM

I tried the extension, but in my case it seems to be very slow. I attach a screenshot. Maybe somebody of you can tell me why it tooks about 5-6 seconds to load each page. This is just a period which is not accepted by my users. Maybe it is a misconfiguration of my server.

Thx
Zebra :-)

Attached File(s)


0

#340 User is offline   Dyp2000 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 16-March 12

Posted 13 April 2012 - 07:08 AM

View PostFredi, on 13 April 2012 - 01:59 AM, said:

Hi ! This is really great extension, although icons in submit button doesn't work for me.

<?php $this->widget('bootstrap.widgets.BootButton', array('fn'=>'submit', 'type'=>'primary', 'icon'=>'ok white', 'label'=>'Submit')); ?>


Result:
<input class="btn btn-primary" type="submit" name="yt1" value="&lt;i class=&quot;icon-ok icon-white&quot;&gt;&lt;/i&gt; Submit">



http://twitter.githu...-css.html#icons
0

Share this topic:


  • (45 Pages)
  • +
  • « First
  • 15
  • 16
  • 17
  • 18
  • 19
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

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