Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
Yii Bootstrap 3
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Common
Yii Bootstrap 3
Commits
947106a4
Commit
947106a4
authored
May 13, 2012
by
Crisu83
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes an issue with form input addons
parent
3abf0951
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
17 deletions
+26
-17
index.php
demo/protected/views/site/index.php
+21
-16
BootInput.php
widgets/input/BootInput.php
+5
-1
No files found.
demo/protected/views/site/index.php
View file @
947106a4
...
...
@@ -482,11 +482,6 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
'dataProvider'=>
\$
listDataProvider,
'template'=>
\"
{
items}\\n{pager
}
\"
,
'itemView'=>'_thumb',
// Remove the existing tooltips and rebind the plugin after each ajax-call.
'afterAjaxUpdate'=>
\"
js:function() {
jQuery('.tooltip').remove();
jQuery('a[rel=tooltip]').tooltip();
}
\"
,
)); ?>"
);
?>
<?php
echo
$htmlLighter
->
highlight
(
"<li class=
\"
span3
\"
>
...
...
@@ -538,17 +533,20 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h2>
Popovers
</h2>
<div
class=
"well"
>
<?php
echo
CHtml
::
link
(
'Hover me'
,
'#'
,
array
(
'class'
=>
'btn btn-primary btn-danger'
,
'data-title'
=>
'Heading'
,
'data-content'
=>
'Content ...'
,
'rel'
=>
'popover'
<?php
$this
->
widget
(
'bootstrap.widgets.BootButton'
,
array
(
'label'
=>
'Hover me'
,
'type'
=>
'danger'
,
'htmlOptions'
=>
array
(
'data-title'
=>
'Heading'
,
'data-content'
=>
'Content ...'
,
'rel'
=>
'popover'
),
));
?>
</div>
<h4>
Source code
</h4>
<?php
echo
$phpLighter
->
highlight
(
"<?php echo CHtml::link('Hover me', '#', array('class'=>'btn btn-primary btn-danger', 'data-title'=>'Heading', 'data-content'=>'Content ...', 'rel'=>'popover')); ?>"
);
?>
<?php
echo
$phpLighter
->
highlight
(
"<?php
\$
this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Hover me',
'type'=>'danger',
'htmlOptions'=>array('data-title'=>'Heading', 'data-content'=>'Content ...', 'rel'=>'popover'),
)); ?>"
);
?>
<a
class=
"top"
href=
"#top"
>
Back to top
↑
</a>
...
...
@@ -585,9 +583,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php
$this
->
endWidget
();
?>
<div
class=
"well"
>
<?php
echo
CHtml
::
link
(
'Click me'
,
'#myModal'
,
array
(
'class'
=>
'btn btn-primary'
,
'data-toggle'
=>
'modal'
,
<?php
$this
->
widget
(
'bootstrap.widgets.BootButton'
,
array
(
'label'
=>
'Click me'
,
'url'
=>
'#myModal'
,
'type'
=>
'primary'
,
'htmlOptions'
=>
array
(
'data-toggle'
=>
'modal'
),
));
?>
</div>
...
...
@@ -618,9 +618,14 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
)); ?>
</div>
<?php
\$
this->endWidget(); ?>
<?php
\$
this->endWidget(); ?>
"
);
?>
<?php echo CHtml::link('Click me','#myModal', array('class'=>'btn btn-primary', 'data-toggle'=>'modal')); ?>"
);
?>
<?php
echo
$phpLighter
->
highlight
(
"<?php
\$
this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Click me',
'url'=>'#myModal',
'type'=>'primary',
'htmlOptions'=>array('data-toggle'=>'modal'),
)); ?>"
);
?>
<a
class=
"top"
href=
"#top"
>
Back to top
↑
</a>
...
...
widgets/input/BootInput.php
View file @
947106a4
...
...
@@ -47,6 +47,8 @@ abstract class BootInput extends CInputWidget
*/
public
$data
=
array
();
private
$_addon
=
false
;
/**
* Initializes the widget.
* @throws CException if the widget could not be initialized.
...
...
@@ -184,6 +186,7 @@ abstract class BootInput extends CInputWidget
echo
'<div class="'
.
$classes
.
'">'
;
if
(
isset
(
$this
->
htmlOptions
[
'prepend'
]))
{
$this
->
_addon
=
true
;
echo
CHtml
::
tag
(
'span'
,
$htmlOptions
,
$this
->
htmlOptions
[
'prepend'
]);
unset
(
$this
->
htmlOptions
[
'prepend'
]);
}
...
...
@@ -217,6 +220,7 @@ abstract class BootInput extends CInputWidget
ob_start
();
if
(
isset
(
$this
->
htmlOptions
[
'append'
]))
{
$this
->
_addon
=
true
;
echo
CHtml
::
tag
(
'span'
,
$htmlOptions
,
$this
->
htmlOptions
[
'append'
]);
unset
(
$this
->
htmlOptions
[
'append'
]);
}
...
...
@@ -335,7 +339,7 @@ abstract class BootInput extends CInputWidget
*/
protected
function
hasAddOn
()
{
return
isset
(
$this
->
htmlOptions
[
'prepend'
])
||
isset
(
$this
->
htmlOptions
[
'append'
]);
return
$this
->
_addon
||
isset
(
$this
->
htmlOptions
[
'prepend'
])
||
isset
(
$this
->
htmlOptions
[
'append'
]);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment