dmstr / yii2-widgets2-module
Yii 2.0 Framework Widget Manager
Installs: 50 059
Dependents: 2
Suggesters: 0
Security: 0
Stars: 9
Watchers: 9
Forks: 8
Open Issues: 7
Type:yii2-extension
Requires
- 2amigos/yii2-ckeditor-widget: ^2.0.2
- 2amigos/yii2-translateable-behavior: ^1.1.0
- bedezign/yii2-audit: ^1.0
- bower-asset/jquery-cookie: ~1.4.1
- dmstr/yii2-active-record-permissions: ^1.0.0
- dmstr/yii2-ajax-button: ^1.0
- dmstr/yii2-json-editor: ^1.0.0
- dmstr/yii2-web: ^0.3.1 || ^0.4.0 || ^1.0.0
- insolita/yii2-adminlte-widgets: ^1.1.4
- justinrainbow/json-schema: ^5.2.0
- kdn/yii2-json-editor: ^2.5.1
- mikehaertl/php-shellcommand: ^1.2.4
- rmrevin/yii2-fontawesome: ~2.9
- scrivo/highlight.php: ~8.0 || ~9.0
- trntv/yii2-aceeditor: ^2.1.0
- yiisoft/yii2: 2.0.*
- yiisoft/yii2-twig: ^2.0.4
- zhuravljov/yii2-datetime-widgets: ^1.1.0
- dev-master
- 2.7.4
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.7.0-beta2
- 2.7.0-beta1
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.0-rc2
- 2.5.0-rc1
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.1
- 2.2.0
- 2.2.0-rc2
- 2.2.0-rc1
- 2.1.0-rc3
- 2.1.0-rc2
- 2.1.0-rc1
- 2.0.1
- 2.0.0
- 2.0.0-rc4
- 2.0.0-rc3
- 2.0.0-rc2
- 2.0.0-rc1
- 2.0.0-beta2
- 2.0.0-beta1
- 2.0.0-alpha8
- 2.0.0-alpha7
- 2.0.0-alpha6
- 2.0.0-alpha5
- 2.0.0-alpha4
- 2.0.0-alpha3
- 2.0.0-alpha2
- 2.0.0-alpha1
- 0.6.8
- 0.6.7
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.6.0-rc6
- 0.6.0-rc5
- 0.6.0-rc4
- 0.6.0-rc3
- 0.6.0-rc2
- 0.6.0-rc1
- 0.5.1
- 0.5.0
- 0.5.0-rc3
- 0.5.0-rc2
- 0.5.0-rc1
- 0.5.0-beta2
- 0.5.0-beta1
- 0.4.20
- 0.4.19
- 0.4.18
- 0.4.17
- 0.4.16
- 0.4.15
- 0.4.14
- 0.4.13
- 0.4.12
- 0.4.11
- 0.4.10
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.4.0-rc7
- 0.4.0-rc6
- 0.4.0-rc5
- 0.4.0-rc4
- 0.4.0-rc3
- 0.4.0-rc2
- 0.4.0-rc1
- 0.4.0-beta4
- 0.4.0-beta3
- 0.4.0-beta2
- 0.4.0-beta1
- 0.4.0-alpha3
- 0.4.0-alpha2
- 0.4.0-alpha1
- 0.3.0
- 0.3.0-rc5
- 0.3.0-rc4
- 0.3.0-rc3
- 0.3.0-rc2
- 0.3.0-rc1
- 0.3.0-beta4
- 0.3.0-beta3
- 0.3.0-beta2
- 0.3.0-beta1
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- 0.0.2
- 0.0.1
- dev-feature/frontend-route-map-param
- dev-feature/elias
- dev-feature/access_owner_uuid
- dev-dev/devgroup-alternative
- dev-dev/filefly-configuration
- dev-feature/frontend-editing
- dev-feature/widget-template-export
- dev-feature/remove-jquery-essential-dependency
- dev-feature/ensure-back-compatibility
- dev-feature/default-route-param
- dev-feature/drag-n-drop-template
- dev-feature/inline-editing
- dev-feature/remove-deprecated-code
- dev-feature/schema-validation
- dev-show
- dev-feature/allow-ajax-in-schema
- dev-feature/postgres-support
- dev-feature/xss-and-improvements
- dev-feature/improved-db-performance
- dev-feature/drag-and-drop
- dev-release/2.x
- dev-feature/widget-page
- dev-feature/obj-props
- dev-dev/init-fix
- dev-feature/js-fix
- dev-feature/2.x-uno-redirects
- dev-feature/translatable
- dev-feature/unify-buttons
This package is auto-updated.
Last update: 2024-12-16 07:41:41 UTC
README
Widget manager using twig templates
Installation
The preferred way to install this extension is through composer.
Either run
composer require dmstr/yii2-widgets2-module
to the require section of your composer.json
file.
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)
Usage
Once the extension is installed, simply use it in your code by :
Layout
Example with yii2-prototype-module
{{ 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
Key: availablePhpClasses
Type: JSON
####Example:
{"hrzg\\widget\\widgets\\TwigTemplate": "Twig layout"}
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
Upgrading
from 0.2 to 0.3
{{ cell_widget({id: 'header'}) }}