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
3ec50ab5
Commit
3ec50ab5
authored
May 25, 2016
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated context menu items
parent
f08ce43e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
README.md
README.md
+4
-1
WidgetContainer.php
src/widgets/WidgetContainer.php
+8
-2
No files found.
README.md
View file @
3ec50ab5
...
...
@@ -50,7 +50,10 @@ Example with `yii2-prototype-module`
```
{{ use ('hrzg/widget/widgets') }}
{{ widget_container_widget({id: 'layout'}) }}
{{ widget_container_widget({id: 'header'}) }}
<div class="container">
{{ widget_container_widget({id: 'container'}) }}
</div>
```
### Widget
...
...
src/widgets/WidgetContainer.php
View file @
3ec50ab5
...
...
@@ -10,6 +10,9 @@
namespace
hrzg\widget\widgets
;
use
hrzg\widget\models\crud\WidgetContent
;
use
rmrevin\yii\fontawesome\AssetBundle
;
use
rmrevin\yii\fontawesome\component\Icon
;
use
rmrevin\yii\fontawesome\FA
;
use
yii\base\Event
;
use
yii\base\Widget
;
use
yii\helpers\Json
;
...
...
@@ -66,9 +69,12 @@ class WidgetContainer extends Widget
public
function
getMenuItems
()
{
AssetBundle
::
register
(
$this
->
view
);
$createIcon
=
(
string
)
FA
::
icon
(
'home'
);
var_dump
(
$createIcon
);
return
[
[
'label'
=>
'Create '
.
$this
->
id
.
'
<span class="label label-info">widget</span>'
,
'label'
=>
FA
::
icon
(
FA
::
_PLUS_SQUARE
)
.
' <b>'
.
$this
->
id
.
'</b>
<span class="label label-info">widget</span>'
,
'url'
=>
[
'/widgets/crud/widget/create'
,
'WidgetContent'
=>
[
...
...
@@ -80,7 +86,7 @@ class WidgetContainer extends Widget
],
],
[
'label'
=>
'Edit '
.
$this
->
id
.
'
<span class="label label-info">widget</span>'
,
'label'
=>
FA
::
icon
(
FA
::
_EDIT
)
.
' <b>'
.
$this
->
id
.
'</b>
<span class="label label-info">widget</span>'
,
'url'
=>
[
'/widgets/crud/widget/index'
,
'WidgetContent'
=>
[
...
...
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