Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
test-project
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Junaid Rahman pv
test-project
Commits
1a7272ce
Commit
1a7272ce
authored
Sep 01, 2016
by
jomon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code review changes
parent
71b55384
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
10 deletions
+19
-10
_form.php
backend/modules/location/views/state/_form.php
+5
-9
index.php
backend/modules/location/views/state/index.php
+3
-0
common.php
backend/views/layouts/common.php
+0
-0
State.php
common/models/State.php
+4
-1
StateQuery.php
common/models/query/StateQuery.php
+7
-0
No files found.
backend/modules/location/views/state/_form.php
View file @
1a7272ce
...
...
@@ -12,35 +12,31 @@ use yii\widgets\ActiveForm;
<?php
$form
=
ActiveForm
::
begin
();
?>
<div
id=
"myTabContent"
class=
"tab-content"
>
<div
class=
"tab-pane fade in active"
id=
"info"
>
<div
class=
"page-header"
>
<h3>
Info
</h3>
</div>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<?php
echo
$form
->
field
(
$model
,
'name'
)
->
textInput
([
'maxlength'
=>
true
])
?>
<?=
$form
->
field
(
$model
,
'name'
)
->
textInput
([
'maxlength'
=>
true
])
?>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<?php
echo
$form
->
field
(
$model
,
'slug'
)
->
textInput
([
'maxlength'
=>
true
])
?>
<?=
$form
->
field
(
$model
,
'slug'
)
->
textInput
([
'maxlength'
=>
true
])
?>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-3"
>
<?=
$form
->
field
(
$model
,
'status'
)
->
dropDownList
(
$model
::
statuses
())
?>
</div>
</div>
<div
class=
"form-group"
>
<?=
Html
::
submitButton
(
$model
->
isNewRecord
?
Yii
::
t
(
'backend'
,
'Create'
)
:
Yii
::
t
(
'backend'
,
'Update'
),
[
'class'
=>
$model
->
isNewRecord
?
'btn btn-success'
:
'btn btn-primary'
])
?>
</div>
</div>
</div>
...
...
backend/modules/location/views/state/index.php
View file @
1a7272ce
...
...
@@ -10,6 +10,7 @@ use yii\grid\GridView;
$this
->
title
=
Yii
::
t
(
'backend'
,
'States'
);
$this
->
params
[
'breadcrumbs'
][]
=
$this
->
title
;
?>
<div
class=
"state-index"
>
<h1>
<?=
Html
::
encode
(
$this
->
title
)
?>
</h1>
...
...
@@ -18,6 +19,7 @@ $this->params['breadcrumbs'][] = $this->title;
<
p
>
<?=
Html
::
a
(
Yii
::
t
(
'backend'
,
'Create State'
),
[
'create'
],
[
'class'
=>
'btn btn-success'
])
?>
</p>
<?=
GridView
::
widget
([
'dataProvider'
=>
$dataProvider
,
'filterModel'
=>
$searchModel
,
...
...
@@ -41,4 +43,5 @@ $this->params['breadcrumbs'][] = $this->title;
[
'class'
=>
'yii\grid\ActionColumn'
],
],
]);
?>
</div>
backend/views/layouts/common.php
View file @
1a7272ce
This diff is collapsed.
Click to expand it.
common/models/State.php
View file @
1a7272ce
...
...
@@ -37,7 +37,6 @@ class State extends \yii\db\ActiveRecord
[
'class'
=>
SluggableBehavior
::
className
(),
'attribute'
=>
'name'
,
'immutable'
=>
true
],
[
'class'
=>
TimestampBehavior
::
className
(),
...
...
@@ -91,6 +90,10 @@ class State extends \yii\db\ActiveRecord
return
new
\common\models\query\StateQuery
(
get_called_class
());
}
/**
* List all status
* @return array
*/
public
static
function
statuses
()
{
return
[
...
...
common/models/query/StateQuery.php
View file @
1a7272ce
...
...
@@ -2,6 +2,8 @@
namespace
common\models\query
;
use
common\models\State
;
/**
* This is the ActiveQuery class for [[\common\models\State]].
*
...
...
@@ -31,4 +33,9 @@ class StateQuery extends \yii\db\ActiveQuery
{
return
parent
::
one
(
$db
);
}
public
function
active
()
{
return
$this
->
andWhere
([
'status'
=>
State
::
STATUS_ACTIVE
]);
}
}
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