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
c2503598
Commit
c2503598
authored
Mar 27, 2012
by
Crisu83
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added support for inputs with both prepend and append (fixes #41)
parent
c6bc778d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
BootInput.php
widgets/input/BootInput.php
+24
-5
No files found.
widgets/input/BootInput.php
View file @
c2503598
...
...
@@ -152,6 +152,11 @@ abstract class BootInput extends CInputWidget
return
''
;
}
/**
* Returns the prepend element for the input.
* @param array $htmlOptions additional HTML attributes
* @return string the element
*/
protected
function
getPrepend
(
$htmlOptions
=
array
())
{
if
(
$this
->
hasAddOn
())
...
...
@@ -173,6 +178,11 @@ abstract class BootInput extends CInputWidget
return
''
;
}
/**
* Returns the append element for the input.
* @param array $htmlOptions additional HTML attributes
* @return string the element
*/
protected
function
getAppend
(
$htmlOptions
=
array
())
{
if
(
$this
->
hasAddOn
())
...
...
@@ -193,16 +203,25 @@ abstract class BootInput extends CInputWidget
return
''
;
}
/**
* Returns the input container CSS classes.
* @return string the classes
*/
protected
function
getInputContainerCssClass
()
{
$class
=
array
();
if
(
isset
(
$this
->
htmlOptions
[
'prepend'
]))
return
'input-prepend'
;
else
if
(
isset
(
$this
->
htmlOptions
[
'append'
]))
return
'input-append'
;
else
return
''
;
$class
[]
=
'input-prepend'
;
if
(
isset
(
$this
->
htmlOptions
[
'append'
]))
$class
[]
=
'input-append'
;
return
implode
(
' '
,
$class
)
;
}
/**
* Returns whether the input has an add-on (prepend and/or append).
* @return boolean the result
*/
protected
function
hasAddOn
()
{
return
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