2017 © Pedro Peláez
 

yii2-extension yii2-widgets2-module

Yii 2.0 Framework Widget Manager

image

dmstr/yii2-widgets2-module

Yii 2.0 Framework Widget Manager

  • Wednesday, July 25, 2018
  • by schmunk
  • Repository
  • 6 Watchers
  • 3 Stars
  • 4,476 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 2 Open issues
  • 87 Versions
  • 19 % Grown

The README.md

Yii2 Widget Module

Latest Stable Version Total Downloads License, (*1)

Widget manager using twig templates, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

composer require dmstr/yii2-widgets2-module

to the require section of your composer.json file., (*5)

Testing

cd tests

docker-compose up -d

docker-compose run phpfpm bash

setup.sh

Config

...
'modules => [
    'widgets' => [
        'class' => '\hrzg\widget\Module',
        'layout' => '@backend/views/layouts/main',
        'playgroundLayout' => '@frontend/views/layouts/main',
        'dateBasedAccessControl' => true,
        'datepickerMinutes' => false,
        'timezone' => 'Europe/Berlin',
        // set ajax option for JsonEditor
        'allowAjaxInSchema' => false,
        // If true, the json content properties will be validated against the json schema from the widget_template.
        // To be BC the default is false, but you should enable it
        'validateContentSchema' => false
    ]
]
...

Settings

availablePhpClasses availableFrontendPhpClasses - Templates with one of the listed classes in this setting will be outputed in cell widgets dropdown for available templates (default: hrzg\widget\widgets\TwigTemplate), (*6)

Usage

Once the extension is installed, simply use it in your code by :, (*7)

Layout

Example with yii2-prototype-module, (*8)

{{ use ('hrzg/widget/widgets') }}
{{ cell_widget({id: 'main'}) }}

Widget

  • Standard Twig widget hrzg\widget\widgets\TwigTemplate
  • Char-Rank ordering 001, 10, 5, aa1, aa1.2, b0 (not numeric)

JSON

Settings

Section: widgets, (*9)

Key: availablePhpClasses, (*10)

Type: JSON, (*11)

Example:

{"hrzg\\widget\\widgets\\TwigTemplate": "Twig layout"}, (*12)

Widget example

Basic

{
    "title": "Basic",
    "type": "object",
    "properties": {
        "headline": {
            "type": "string",
            "default": "Avo vole tioma profitanto ts,"
        },
        "text_html": {
            "type": "string",
            "format": "html",
            "default": "Ja sub kiam aliu, fo unt fora danke helpverbo, dev bv tele kibi piedpilko.",
            "options": {
                "wysiwyg": true
            }
        }
    }
}
<h2>{{ headline }}</h2>
<p>{{ text_html }}</p>

For more examples, please see the docs, (*13)

Upgrading

from 0.2 to 0.3

{{ cell_widget({id: 'header'}) }}

RBAC

Available Permission items

Name Description
widgets_default_index Widgets Manager
widgets_crud_api Widgets CRUD API
widgets_crud_widget Widgets CRUD Content
widgets_crud_widget_create Widgets CRUD Content Create
widgets_crud_widget_delete Widgets CRUD Content Delete
widgets_crud_widget_index Widgets CRUD Content Index
widgets_crud_widget_update Widgets CRUD Content Update
widgets_crud_widget_view Widgets CRUD Content View
widgets_crud_widget-template Widgets CRUD Template
widgets_test Widgets TEST Playground
widgets-cell-edit Frontend editing
widgets Widgets Module

Settings

Section Key Value Type
widgets ckeditor.config
    {
      "height": "4000px",
      "toolbar": [
        ["Format"],
        ["Link", "Image", "Table", "-", "NumberedList", "BulletedList", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"],
        ["Source"],
        "/", ["Bold", "Italic", "Underline", "StrikeThrough", "-", "RemoveFormat", "-", "Undo", "Redo", "-", "Paste", "PasteText", "PasteFromWord", "-", "Cut", "Copy", "Find", "Replace", "-", "Outdent", "Indent", "-", "Print"]
      ]
    }
OBJECT/JSON

The Versions

04/04 2018

0.2.3

0.2.3.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

04/04 2018
09/02 2017

0.4.0-beta4

0.4.0.0-beta4

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

08/02 2017

0.4.0-beta3

0.4.0.0-beta3

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

01/02 2017

0.4.0-beta2

0.4.0.0-beta2

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

31/01 2017

0.4.0-beta1

0.4.0.0-beta1

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

22/12 2016

0.4.0-alpha3

0.4.0.0-alpha3

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

14/12 2016

0.4.0-alpha2

0.4.0.0-alpha2

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

09/12 2016

0.4.0-alpha1

0.4.0.0-alpha1

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

09/12 2016
18/11 2016
11/11 2016
10/11 2016

0.3.0-rc2

0.3.0.0-RC2

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

05/10 2016

0.3.0-rc1

0.3.0.0-RC1

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

18/08 2016

0.3.0-beta4

0.3.0.0-beta4

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

02/08 2016

0.3.0-beta3

0.3.0.0-beta3

Yii 2.0 Framework Widget Manager

  Sources   Download

proprietary

The Requires

 

extension yii2

20/07 2016

0.3.0-beta2

0.3.0.0-beta2

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

20/07 2016

0.3.0-beta1

0.3.0.0-beta1

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

14/07 2016

0.2.2

0.2.2.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

13/07 2016

0.2.1

0.2.1.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

29/06 2016

0.2.0

0.2.0.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

28/06 2016

0.1.6

0.1.6.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

25/05 2016

0.1.5

0.1.5.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

25/05 2016

0.1.4

0.1.4.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

25/05 2016

0.1.3

0.1.3.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

25/05 2016

0.1.2

0.1.2.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

19/05 2016

0.1.1

0.1.1.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

19/05 2016

0.1.0

0.1.0.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

18/05 2016

0.0.2

0.0.2.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

05/04 2016

0.0.1

0.0.1.0

Yii 2.0 Framework Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2