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
91fd8b96
Commit
91fd8b96
authored
Dec 01, 2011
by
cniska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed a file and some methods.
Renamed BootInputBlock to BootInput. Renamed all the block methods in BootActiveForm to row.
parent
d5a582c7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
55 deletions
+55
-55
BootstrapCode.php
gii/bootstrap/BootstrapCode.php
+1
-1
_form.php
gii/bootstrap/templates/default/_form.php
+1
-1
_search.php
gii/bootstrap/templates/default/_search.php
+1
-1
BootActiveForm.php
widgets/BootActiveForm.php
+51
-51
BootInput.php
widgets/BootInput.php
+1
-1
No files found.
gii/bootstrap/BootstrapCode.php
View file @
91fd8b96
...
...
@@ -9,7 +9,7 @@
Yii
::
import
(
'gii.generators.crud.CrudCode'
);
class
BootstrapCode
extendS
CrudCode
{
public
function
generateActive
Block
(
$modelClass
,
$column
)
public
function
generateActive
Row
(
$modelClass
,
$column
)
{
if
(
$column
->
type
===
'boolean'
)
return
"
\$
form->checkBoxBlock(
\$
model,'
{
$column
->
name
}
')"
;
...
...
gii/bootstrap/templates/default/_form.php
View file @
91fd8b96
...
...
@@ -19,7 +19,7 @@ foreach($this->tableSchema->columns as $column)
if
(
$column
->
autoIncrement
)
continue
;
?>
<?php
echo
"<?php echo "
.
$this
->
generateActive
Block
(
$this
->
modelClass
,
$column
)
.
"; ?>
\n
"
;
?>
<?php
echo
"<?php echo "
.
$this
->
generateActive
Row
(
$this
->
modelClass
,
$column
)
.
"; ?>
\n
"
;
?>
<?php
}
...
...
gii/bootstrap/templates/default/_search.php
View file @
91fd8b96
...
...
@@ -15,7 +15,7 @@
if
(
strpos
(
$field
,
'password'
)
!==
false
)
continue
;
?>
<?php
echo
"<?php echo "
.
$this
->
generateActive
Block
(
$this
->
modelClass
,
$column
)
.
"; ?>
\n
"
;
?>
<?php
echo
"<?php echo "
.
$this
->
generateActive
Row
(
$this
->
modelClass
,
$column
)
.
"; ?>
\n
"
;
?>
<?php
endforeach
;
?>
<div
class=
"actions"
>
...
...
widgets/BootActiveForm.php
View file @
91fd8b96
...
...
@@ -39,18 +39,18 @@ class BootActiveForm extends CActiveForm
}
/**
* Creates an input
block
of a specific type.
* Creates an input
row
of a specific type.
* @param string $type the input type
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $data the data for list inputs
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
input
Block
(
$type
,
$model
,
$attribute
,
$data
=
null
,
$htmlOptions
=
array
())
public
function
input
Row
(
$type
,
$model
,
$attribute
,
$data
=
null
,
$htmlOptions
=
array
())
{
ob_start
();
Yii
::
app
()
->
controller
->
widget
(
'ext.bootstrap.widgets.BootInput
Block
'
,
array
(
Yii
::
app
()
->
controller
->
widget
(
'ext.bootstrap.widgets.BootInput'
,
array
(
'type'
=>
$type
,
'form'
=>
$this
,
'model'
=>
$model
,
...
...
@@ -62,140 +62,140 @@ class BootActiveForm extends CActiveForm
}
/**
* Renders a checkbox input
block
.
* Renders a checkbox input
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
checkBox
Block
(
$model
,
$attribute
,
$htmlOptions
=
array
())
public
function
checkBox
Row
(
$model
,
$attribute
,
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'checkbox'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
return
$this
->
input
Row
(
'checkbox'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
}
/**
* Renders a checkbox list input
block
.
* Renders a checkbox list input
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $data the list data
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
checkBoxList
Block
(
$model
,
$attribute
,
$data
=
array
(),
$htmlOptions
=
array
())
public
function
checkBoxList
Row
(
$model
,
$attribute
,
$data
=
array
(),
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'checkboxlist'
,
$model
,
$attribute
,
$data
,
$htmlOptions
);
return
$this
->
input
Row
(
'checkboxlist'
,
$model
,
$attribute
,
$data
,
$htmlOptions
);
}
/**
* Renders a drop-down list input
block
.
* Renders a drop-down list input
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $data the list data
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
dropDownList
Block
(
$model
,
$attribute
,
$data
=
array
(),
$htmlOptions
=
array
())
public
function
dropDownList
Row
(
$model
,
$attribute
,
$data
=
array
(),
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'dropdownlist'
,
$model
,
$attribute
,
$data
,
$htmlOptions
);
return
$this
->
input
Row
(
'dropdownlist'
,
$model
,
$attribute
,
$data
,
$htmlOptions
);
}
/**
* Renders a file field input
block
.
* Renders a file field input
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
fileField
Block
(
$model
,
$attribute
,
$htmlOptions
=
array
())
public
function
fileField
Row
(
$model
,
$attribute
,
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'filefield'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
return
$this
->
input
Row
(
'filefield'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
}
/**
* Renders a password field input
block
.
* Renders a password field input
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
passwordField
Block
(
$model
,
$attribute
,
$htmlOptions
=
array
())
public
function
passwordField
Row
(
$model
,
$attribute
,
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'password'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
return
$this
->
input
Row
(
'password'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
}
/**
* Renders a radio button input
block
.
* Renders a radio button input
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
radioButton
Block
(
$model
,
$attribute
,
$htmlOptions
=
array
())
public
function
radioButton
Row
(
$model
,
$attribute
,
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'radiobutton'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
return
$this
->
input
Row
(
'radiobutton'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
}
/**
* Renders a radio button list input
block
.
* Renders a radio button list input
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $data the list data
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
radioButtonList
Block
(
$model
,
$attribute
,
$data
=
array
(),
$htmlOptions
=
array
())
public
function
radioButtonList
Row
(
$model
,
$attribute
,
$data
=
array
(),
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'radiobuttonlist'
,
$model
,
$attribute
,
$data
,
$htmlOptions
);
return
$this
->
input
Row
(
'radiobuttonlist'
,
$model
,
$attribute
,
$data
,
$htmlOptions
);
}
/**
* Renders a text field input
block
.
* Renders a text field input
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
textField
Block
(
$model
,
$attribute
,
$htmlOptions
=
array
())
public
function
textField
Row
(
$model
,
$attribute
,
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'textfield'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
return
$this
->
input
Row
(
'textfield'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
}
/**
* Renders a text area input
block
.
* Renders a text area input
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
*/
public
function
textArea
Block
(
$model
,
$attribute
,
$htmlOptions
=
array
())
public
function
textArea
Row
(
$model
,
$attribute
,
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'textarea'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
return
$this
->
input
Row
(
'textarea'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
}
/**
* Renders a captcha
block
.
* Renders a captcha
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
* @since 0.9.3
*/
public
function
captcha
Block
(
$model
,
$attribute
,
$htmlOptions
=
array
())
public
function
captcha
Row
(
$model
,
$attribute
,
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'captcha'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
return
$this
->
input
Row
(
'captcha'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
}
/**
* Renders an uneditable text field
block
.
* Renders an uneditable text field
row
.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $htmlOptions additional HTML attributes
* @return string the generated
block
* @return string the generated
row
* @since 0.9.5
*/
public
function
uneditable
Block
(
$model
,
$attribute
,
$htmlOptions
=
array
())
public
function
uneditable
Row
(
$model
,
$attribute
,
$htmlOptions
=
array
())
{
return
$this
->
input
Block
(
'uneditable'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
return
$this
->
input
Row
(
'uneditable'
,
$model
,
$attribute
,
null
,
$htmlOptions
);
}
/**
...
...
@@ -247,7 +247,7 @@ class BootActiveForm extends CActiveForm
CHtml
::
resolveNameID
(
$model
,
$attribute
,
$htmlOptions
);
$selection
=
CHtml
::
resolveValue
(
$model
,
$attribute
);
if
(
$model
->
hasErrors
(
$attribute
))
if
(
$model
->
hasErrors
(
$attribute
))
{
if
(
isset
(
$htmlOptions
[
'class'
]))
$htmlOptions
[
'class'
]
.=
' '
.
CHtml
::
$errorCss
;
...
...
@@ -258,7 +258,7 @@ class BootActiveForm extends CActiveForm
$name
=
$htmlOptions
[
'name'
];
unset
(
$htmlOptions
[
'name'
]);
if
(
array_key_exists
(
'uncheckValue'
,
$htmlOptions
))
if
(
array_key_exists
(
'uncheckValue'
,
$htmlOptions
))
{
$uncheck
=
$htmlOptions
[
'uncheckValue'
];
unset
(
$htmlOptions
[
'uncheckValue'
]);
...
...
@@ -392,7 +392,7 @@ class BootActiveForm extends CActiveForm
if
(
$html
===
''
)
{
if
(
isset
(
$htmlOptions
[
'style'
]))
if
(
isset
(
$htmlOptions
[
'style'
]))
$htmlOptions
[
'style'
]
=
rtrim
(
$htmlOptions
[
'style'
],
';'
)
.
';display:none'
;
else
$htmlOptions
[
'style'
]
=
'display:none'
;
...
...
widgets/BootInput
Block
.php
→
widgets/BootInput.php
View file @
91fd8b96
...
...
@@ -6,7 +6,7 @@
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
class
BootInput
Block
extends
CInputWidget
class
BootInput
extends
CInputWidget
{
/**
* @property BootActiveForm the associated form widget.
...
...
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