Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-widgets2-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hrzg
yii2-widgets2-module
Commits
14a4147c
Commit
14a4147c
authored
May 17, 2016
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added create buttons for overview page
parent
645a66c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
DefaultController.php
src/controllers/DefaultController.php
+4
-1
_create-widget.php
src/views/default/_create-widget.php
+15
-0
index.php
src/views/default/index.php
+12
-0
No files found.
src/controllers/DefaultController.php
View file @
14a4147c
...
...
@@ -2,12 +2,15 @@
namespace
hrzg\widget\controllers
;
use
hrzg\widget\models\crud\search\WidgetTemplate
;
use
yii\web\Controller
;
class
DefaultController
extends
Controller
{
public
function
actionIndex
()
{
return
$this
->
render
(
'index'
);
$searchModel
=
new
WidgetTemplate
;
$dataProvider
=
$searchModel
->
search
([]);
return
$this
->
render
(
'index'
,
[
'templatesDataProvider'
=>
$dataProvider
]);
}
}
src/views/default/_create-widget.php
0 → 100644
View file @
14a4147c
<?php
namespace
_
;
use
insolita\wgadminlte\Box
;
use
yii\helpers\Html
;
?>
<div
class=
"col-sm-3"
>
<?=
Html
::
a
(
$model
->
name
,
[
'/widgets/crud/widget/create'
,
'templateId'
=>
$model
->
id
],
[
'class'
=>
'btn btn-default btn-block'
])
?>
</div>
src/views/default/index.php
View file @
14a4147c
...
...
@@ -2,8 +2,10 @@
namespace
_
;
use
insolita\wgadminlte\Box
;
use
rmrevin\yii\fontawesome\FA
;
use
yii\helpers\Inflector
;
use
yii\widgets\ListView
;
/*
* @var yii\web\View $this
...
...
@@ -25,3 +27,13 @@ use yii\helpers\Inflector;
'footer_link'
=>
[
'crud/widget-template'
]
]
)
?>
<?php
Box
::
begin
([
'title'
=>
'Create new widgets'
])
?>
<div
class=
"row"
>
<?=
ListView
::
widget
([
'dataProvider'
=>
$templatesDataProvider
,
'itemView'
=>
'_create-widget'
])
?>
</div>
<?php
Box
::
end
()
?>
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