zeonism
(Zeonism)
June 14, 2012, 10:08am
481
Some call it magic… well it’s quite easy…
'content'=>$this->widget('bootstrap.widgets.BootDetailView', array(
'data'=>array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'language'=>'CSS'),
'attributes'=>array(
array('name'=>'firstName', 'label'=>'First name'),
array('name'=>'lastName', 'label'=>'Last name'),
array('name'=>'language', 'label'=>'Language'),
),
), true),
$this->widget(widgetName, dataArray)
… writes the output directly to the page because the default of the 3rd parameter is false.
$this->widget(widgetName, dataArray, true )
… "captures" the output and returns it as String object.
Here is the class reference.
…
You can also make use of renderPartial() for long content that needs a lot of additional php code and stuff…
'content'=>$this->renderPartial('filename', array(), true, false),
Put all code/content in ‘filename.php’ pass variables in array() as usual. With some clever logic you could have only 1 extra file for all the tabs’ contents.
Yii-Haw!
Great it works!! Thanks a million Don! You’ve made my day
Will definitely put the latter trick in mind, seems really helpful.
Andy
Hi There,
Got another question here, what if I wanna render image inside (HTMLs) inside the BootDetailView how do I do that?
'content'=>$this->widget('bootstrap.widgets.BootDetailView', array(
'data'=>array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'imageLink'=>'h t tp://xxx.xxx.com/images/xxx.jpg'),
'attributes'=>array(
array('name'=>'firstName', 'label'=>'First name'),
array('name'=>'lastName', 'label'=>'Last name'),
array('name'=>'imageLink', 'label'=>'Profile picture'),
),
), true),
Current config (true) will render the output as strings so the output looks like :
First name: Mark
Last name: Otto
Profile picture: ht tp://xxx.xxx.com/images/xxx.jpg
instead of
First name: Mark
Last name: Otto
Profile picture: [Picture]
Does anyone know how to go about doing this?
Andy
YurkaTim
(U Tim)
June 22, 2012, 9:08am
482
Hi All!
I’m trying to use the great extension and stuck attempting to add Ajax functionality to BootMenu.
Just wanted to replace dropDownList for BootMenu and … no luck.
Does Bootmenu support something similar to:
CHtml::dropDownList($model,'id',$data,
array(
'ajax'=>array(
'type'=>'POST',
'url'=>'some_url',
'data'=>array('id'=>'js:this.value'),
),
)
);
Any ideas? Maybe there is a way to achieve this with JQuery ?
Thanks in advance.
Drini
(Idrini)
June 22, 2012, 10:07am
483
I believe BootListView have a syntax problem when you add ‘afterAjaxUpdate’ to options.
One that does not occure with CListView.
YurkaTim
(U Tim)
June 22, 2012, 2:03pm
484
Sampa, thanks for reply.
It looks like BootMenu extends Cmenu that is not supporting any ajax options for its items at all.
So, I still have no idea about how to make the BootMenu items Ajax compatible
Drini
(Idrini)
June 23, 2012, 9:42am
485
YurkaTim:
Sampa, thanks for reply.
It looks like BootMenu extends Cmenu that is not supporting any ajax options for its items at all.
So, I still have no idea about how to make the BootMenu items Ajax compatible
Oh I wasnt responding to you I was reporting a random error I came across
But okey, your dropdownlist is nothing other then a normal dropdownlist… generated thrue php:p
So u can do same things as if u were using another framework etc.
if your model is named Foo then at bottom
<script type="text/javascript">
$("#Foo_id").change(function(){
$.ajax.....//any js code.
});
Hello,
Someone know how I can manually open an alert ? After an ajax request for example.
Thanks
yiidf
(Don Felipe)
June 24, 2012, 3:27am
487
Try something like this…
user()->setFlash('error', 'your error message');
$this->widget('bootstrap.widgets.BootAlert', array(
'htmlOptions'=>array('id'=>'myAlert', 'style'=>'display:none;'),
));
Then in your ajax callback, you show or fade in the alert:
$('#myAlert').show();
Not sure if there’s another way to achieve this.
ekerazha
(Ekerazha)
June 24, 2012, 9:21am
488
Bootstrap uses Glyphicons Free.
The demo page infringes the Glyphicons Free license because it doesn’t “add a link to glyphicons.com in a prominent place (e.g. the footer of a website), include the CC-BY license and the reference to glyphicons.com on every page using Glyphicons ”
See: http://glyphicons.co …icons-licenses/
ee0pdt
(Junk)
June 26, 2012, 12:10pm
489
Hi guys, I was wondering if anyone had a neat way to auto-close alerts (the flash messages) after, say, 10 seconds?
micz
(Micz84)
June 28, 2012, 11:30am
490
I have problem with widgets it looks like jquery do not work. Dorpdowns do not drop, slider is a list and so on.
a("body").on is not a function
[Wstrzymuj na tym błędzie]
...entTarget)[this.type](this._options).data(this.type);if(!c.options.delay||!c.opt...
bootstrap.mini.js line 6
now i get
jQuery("a[rel=\"tooltip\"]").tooltip is not a function
jQuery('a[rel="tooltip"]').tooltip();
OK i have commented line 132 and 133 in Bootstrap.php and now it is working but it is temporary solution. I would really appreciate if someone could tell me what can cause this problems.
//$this->registerTooltip();
//$this->registerPopover();
dyp2000
(Dyp2000)
June 30, 2012, 3:20am
491
Hi!
Animation not working on the carousel. How do I fix it?
On your demo site does not work either.
zeonism
(Zeonism)
June 30, 2012, 4:13am
492
Some call it magic… well it’s quite easy…
'content'=>$this->widget('bootstrap.widgets.BootDetailView', array(
'data'=>array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'language'=>'CSS'),
'attributes'=>array(
array('name'=>'firstName', 'label'=>'First name'),
array('name'=>'lastName', 'label'=>'Last name'),
array('name'=>'language', 'label'=>'Language'),
),
), true),
$this->widget(widgetName, dataArray)
… writes the output directly to the page because the default of the 3rd parameter is false.
$this->widget(widgetName, dataArray, true )
… "captures" the output and returns it as String object.
Here is the class reference.
…
You can also make use of renderPartial() for long content that needs a lot of additional php code and stuff…
'content'=>$this->renderPartial('filename', array(), true, false),
Put all code/content in ‘filename.php’ pass variables in array() as usual. With some clever logic you could have only 1 extra file for all the tabs’ contents.
Yii-Haw!
Great it works!! Thanks a million Don! You’ve made my day
Will definitely put the latter trick in mind, seems really helpful.
Andy
Hi There,
Got another question here, what if I wanna render image inside (HTMLs) inside the BootDetailView how do I do that?
'content'=>$this->widget('bootstrap.widgets.BootDetailView', array(
'data'=>array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'imageLink'=>'h t tp://xxx.xxx.com/images/xxx.jpg'),
'attributes'=>array(
array('name'=>'firstName', 'label'=>'First name'),
array('name'=>'lastName', 'label'=>'Last name'),
array('name'=>'imageLink', 'label'=>'Profile picture'),
),
), true),
Current config (true) will render the output as strings so the output looks like :
First name: Mark
Last name: Otto
Profile picture: ht tp://xxx.xxx.com/images/xxx.jpg
instead of
First name: Mark
Last name: Otto
Profile picture: [Picture]
Does anyone know how to go about doing this?
Andy
yiidf
(Don Felipe)
July 1, 2012, 4:34am
493
Hi There,
Got another question here, what if I wanna render image inside (HTMLs) inside the BootDetailView how do I do that?
'content'=>$this->widget('bootstrap.widgets.BootDetailView', array(
'data'=>array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'imageLink'=>'h t tp://xxx.xxx.com/images/xxx.jpg'),
'attributes'=>array(
array('name'=>'firstName', 'label'=>'First name'),
array('name'=>'lastName', 'label'=>'Last name'),
array('name'=>'imageLink', 'label'=>'Profile picture'),
),
), true),
Current config (true) will render the output as strings so the output looks like :
First name: Mark
Last name: Otto
Profile picture: ht tp://xxx.xxx.com/images/xxx.jpg
instead of
First name: Mark
Last name: Otto
Profile picture: [Picture]
Does anyone know how to go about doing this?
Andy
There’s always another question. Please make yourself familiar with the Yii class reference. All the answers are there! Yii-Bootstrap widgets extend the original Yii widgets hence you can make use of all the original options, too.
BootDetailView extends CDetailView - API is here. What needs to be done to have a link inside the view is the same that needs to be done to display an image.
In data simply add CHtml::image(src, alt, htmlOptions) and then you need to define the image attribute to be of type raw . If you need the image as link, put the CHtml::image() inside CHtml::link(). Using the old-fashioned way to render the widget:
$this->widget('bootstrap.widgets.BootDetailView', array(
'data'=>array(
'id'=>1,
'firstName'=>'Mark',
'lastName'=>'Otto',
'imageLink'=>CHtml::image(
'http://www.placehold.it/200x100&text=yii-haw!',
'alt',
array('width'=>50, 'class'=>'className')
)
),
'attributes'=>array(
array('name'=>'firstName', 'label'=>'First name'),
array('name'=>'lastName', 'label'=>'Last name'),
array('name'=>'imageLink', 'label'=>'Profile picture', 'type'=>'raw'),
),
));
Type raw is available in other widgets eg CGridView, too.
Have fun!
yiidf
(Don Felipe)
July 1, 2012, 4:59am
494
micz:
I have problem with widgets it looks like jquery do not work. Dorpdowns do not drop, slider is a list and so on.
a("body").on is not a function
[Wstrzymuj na tym błędzie]
...entTarget)[this.type](this._options).data(this.type);if(!c.options.delay||!c.opt...
bootstrap.mini.js line 6
now i get
jQuery("a[rel=\"tooltip\"]").tooltip is not a function
jQuery('a[rel="tooltip"]').tooltip();
OK i have commented line 132 and 133 in Bootstrap.php and now it is working but it is temporary solution. I would really appreciate if someone could tell me what can cause this problems.
//$this->registerTooltip();
//$this->registerPopover();
This is confusing. So you have commented the lines and then it’s working?
That means the functionality comes from another jQuery lib that is included.
Make sure there is no (JS) conflict and you’re using jQuery 1.7.1.
yiidf
(Don Felipe)
July 1, 2012, 5:07am
495
Hi guys, I was wondering if anyone had a neat way to auto-close alerts (the flash messages) after, say, 10 seconds?
Well, there was a discussion on Twitter’s Bootstrap forum about this and there is no neat way and option to auto-hide any alert hence you need to add this manually. Give the alert object an ID and fade/hide the ID after whatever timeout/delay. If you want to auto-hide all or some alerts use a classname instead.
renathy
(Renate Vidruska)
July 1, 2012, 11:06am
496
BootModal not working.
I have created view test.php with the foloowing copy/paste code from example:
<?php $this->beginWidget('bootstrap.widgets.BootModal', array('id'=>'myModal')); ?>
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body...</p>
</div>
<div class="modal-footer">
<?php $this->widget('bootstrap.widgets.BootButton', array(
'type'=>'primary',
'label'=>'Save changes',
'url'=>'#',
'htmlOptions'=>array('data-dismiss'=>'modal'),
)); ?>
<?php $this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Close',
'url'=>'#',
'htmlOptions'=>array('data-dismiss'=>'modal'),
)); ?>
</div>
<?php $this->endWidget(); ?>
<?php $this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Click me',
'url'=>'#myModal',
'type'=>'primary',
'htmlOptions'=>array('data-toggle'=>'modal'),
)); ?>
I do see a button, but nothing happens when I click on it. I do not see any modal window on button click. I do not know where to look at to fix it.
Raoul
(Manu34)
July 1, 2012, 3:38pm
497
Hi renathy,
I cut/paste your code and it works fine for me. Check that bootstrap-alert.js is loaded in your page. I’m using version 0.9.11.
ciao
Raoul
(Manu34)
July 1, 2012, 4:26pm
498
… and now tested with latest release : 0.10.1.beta.r254 : your code work fine.
On the other hand, I’ve found another bug related to the afterAjaxUpdate option for the BootGridView widget. It is the same bug as the one fixed for the [b]BootListView /b .
ciao
darkult
(Rolando Guedes)
July 3, 2012, 9:40am
499
Hey, guys!
Maybe I’m doing something wrong, but I cannot load bootstrap.
My config/main.php
'preload'=>array('log', 'bootstrap'),
'components'=>array(
'bootstrap' => array('class' => 'ext.bootstrap.components.Bootstrap'
),
)
My layout/main.php
<?php if(isset($this->breadcrumbs)):?>
<?php $this->widget('bootstrap.widgets.BootBreadcrumbs', array(
'links'=>$this->breadcrumbs,
)); ?><!-- breadcrumbs -->
<?php endif?>
Give me a error:
Alias "bootstrap.widgets.BootBreadcrumbs" is invalid. Make sure it points to an existing directory or file.
And don’t load css and js.
Raoul
(Manu34)
July 3, 2012, 6:58pm
500
Hi,
your code works fine on my sample app…Did you install ‘bootstrap’ into your extensions folder ? … just in case, note that ‘boostrap’ folder should be lower case.
With version 0.10.1-beta.r254 You should have following folder structure :
protected\extensions\bootstrap
+-----assets
+-----components
+-----lib
+-----gii
+-----widgets
You could also try to write :
$this->widget('ext.bootstrap.widgets.BootBreadcrumbs', array(
'links'=>array('Library'=>'#', 'Data'),
));
hope this helps…