pax_global_header 0000666 0000000 0000000 00000000064 13022412037 0014504 g ustar 00root root 0000000 0000000 52 comment=20cc113446c46a59f17ab4f3dbb904bc7c3c663d
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/ 0000775 0000000 0000000 00000000000 13022412037 0023725 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/Makefile 0000664 0000000 0000000 00000001003 13022412037 0025357 0 ustar 00root root 0000000 0000000 lint:
mkdir -p _artifacts/lint && chmod -R 777 _artifacts/lint
docker run --rm -v "${PWD}:/project" jolicode/phaudit php-cs-fixer fix --format=txt -v --dry-run src || export ERROR=1; \
docker run --rm -v "${PWD}:/project" jolicode/phaudit phpmetrics --report-html=_artifacts/lint/metrics.html src/ || ERROR=1; \
docker run --rm -v "${PWD}:/project" jolicode/phaudit phpmd src html cleancode,codesize,controversial,design,unusedcode,tests/phpmd/naming.xml > _artifacts/lint/mess.html || ERROR=1; \
exit ${ERROR} yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/README.md 0000664 0000000 0000000 00000003453 13022412037 0025211 0 ustar 00root root 0000000 0000000 widget Module
===============
Yii 2.0 Framework Widget Manager
Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
composer require hrzg/yii2-widgets2-module
```
to the require section of your `composer.json` file.
Startup
-------
```
cd tests
docker-compose up -d
docker-compose run phpfpm bash
setup.sh
```
### Settings
`availablePhpClasses`
Usage
-----
Once the extension is installed, simply use it in your code by :
### Layout
Example with `yii2-prototype-module`
- [Yii 2.0 Twig extension](https://github.com/yiisoft/yii2-twig/tree/master/docs/guide)
- [Twig documentation](http://twig.sensiolabs.org/documentation)
```
{{ 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
- [JSON schema editor](https://github.com/jdorn/json-editor)
### 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
}
}
}
}
```
```
{{ headline }}
{{ text_html }}
```
:warning: Workaround required for editor asset.
```
```
For more examples, please see the [docs](./docs)
Upgrading
---------
### from 0.2 to 0.3
{{ cell_widget({id: 'header'}) }} yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/composer.json 0000664 0000000 0000000 00000001071 13022412037 0026446 0 ustar 00root root 0000000 0000000 {
"name": "hrzg/yii2-widgets2-module",
"description": "Yii 2.0 Framework Widget Manager",
"type": "yii2-extension",
"keywords": [
"yii2",
"extension"
],
"license": "proprietary",
"authors": [
{
"name": "Tobias Munk",
"email": "tobias@diemeisterei.de"
}
],
"require": {
"yiisoft/yii2": "2.*",
"yiisoft/yii2-twig": "^2.0.4",
"dmstr/yii2-web": ">=0.3.1",
"beowulfenator/yii2-json-editor": "^1.1",
"bedezign/yii2-audit": "^1.0"
},
"autoload": {
"psr-4": {
"hrzg\\widget\\": "src/"
}
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/docs/ 0000775 0000000 0000000 00000000000 13022412037 0024655 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/docs/UPGRADING.md 0000664 0000000 0000000 00000000236 13022412037 0026520 0 ustar 00root root 0000000 0000000 ### 0.2 to 0.3
UPDATE `app_twig` SET `value` = REPLACE(`value`, 'widget_container_widget', 'cell_widget') WHERE `value` LIKE '%widget_container_widget%'
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/docs/app_claus_widgets_json.sql0000664 0000000 0000000 00000007670 13022412037 0032136 0 ustar 00root root 0000000 0000000 "id","name","json_schema","editor_settings","form"
1,"Block Widget","{
\"title\": \"Block Widget\",
\"type\": \"object\",
\"properties\": {
\"blocks\": {
\"type\": \"array\",
\"format\": \"table\",
\"title\": \"Block\",
\"uniqueItems\": true,
\"items\": {
\"type\": \"object\",
\"title\": \"Block\",
\"properties\": {
\"above_subline\": {
\"type\": \"string\"
},
\"headline\": {
\"type\": \"string\"
},
\"subline\": {
\"type\": \"string\"
},
\"image_url\": {
\"type\": \"string\",
\"format\": \"url\"
},
\"text_html\": {
\"type\": \"string\",
\"format\": \"html\",
\"options\": {
\"wysiwyg\": true
}
},
\"button\": {
\"type\": \"string\"
}
}
}
}
}
}","",""
2,"Slider Widget","{
\"title\": \"Slider Widget\",
\"type\": \"object\",
\"properties\": {
\"slides\": {
\"type\": \"array\",
\"format\": \"table\",
\"title\": \"Slides\",
\"uniqueItems\": true,
\"items\": {
\"type\": \"object\",
\"title\": \"Slide\",
\"properties\": {
\"above_subline\": {
\"type\": \"string\"
},
\"picture_url\": {
\"type\": \"string\",
\"format\": \"url\"
},
\"headline\": {
\"type\": \"string\"
},
\"subline\": {
\"type\": \"string\"
},
\"text_html\": {
\"type\": \"string\",
\"format\": \"html\",
\"options\": {
\"wysiwyg\": true
}
}
}
}
}
}
}","",""
3,"Video Background Widget","{
\"title\": \"Video Background Widget\",
\"type\": \"object\",
\"properties\": {
\"youtube_id\": {
\"type\": \"string\"
},
\"above_subline\": {
\"type\": \"string\"
},
\"picture_url\": {
\"type\": \"string\",
\"format\": \"url\"
},
\"headline\": {
\"type\": \"string\"
},
\"subline\": {
\"type\": \"string\"
},
\"button\": {
\"type\": \"string\"
}
}
}","",""
4,"Icon Slider Widget","{
\"title\": \"Icon Slider Widget\",
\"type\": \"object\",
\"properties\": {
\"above_subline\": {
\"type\": \"string\"
},
\"headline\": {
\"type\": \"string\"
},
\"subline\": {
\"type\": \"string\"
},
\"blocks\": {
\"type\": \"array\",
\"format\": \"table\",
\"title\": \"Icons\",
\"uniqueItems\": true,
\"items\": {
\"type\": \"object\",
\"title\": \"Icons\",
\"properties\": {
\"picture_url\": {
\"type\": \"string\",
\"format\": \"url\"
}
}
}
}
}
}
","",""
5,"Gallery Widget","{
\"title\": \"Gallery Widget\",
\"type\": \"object\",
\"properties\": {
\"blocks\": {
\"type\": \"array\",
\"format\": \"table\",
\"title\": \"Images\",
\"uniqueItems\": true,
\"items\": {
\"type\": \"object\",
\"title\": \"Image\",
\"properties\": {
\"picture_url\": {
\"type\": \"string\",
\"format\": \"url\"
},
\"text_html\": {
\"type\": \"string\",
\"format\": \"html\",
\"options\": {
\"wysiwyg\": true
}
}
}
}
}
}
}
","",""
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/docs/examples.md 0000664 0000000 0000000 00000007611 13022412037 0027022 0 ustar 00root root 0000000 0000000 APP CLAUS WIDGET TEMPLATES (JSON)
=================================
## Layout
```
{{ use ('hrzg/widget/widgets') }}
{{ cell_widget({id: 'header'}) }}
{{ cell_widget({id: 'container'}) }}
```
```
{{ use ('hrzg/widget/widgets') }}
{{ cell_widget({id: 'header'}) }}
{{ cell_widget({id: 'block1'}) }}
{{ cell_widget({id: 'block2'}) }}
{{ cell_widget({id: 'block3'}) }}
```
*Block Widget*
----------------
```
{
"title": "Block Widget",
"type": "object",
"properties": {
"blocks": {
"type": "array",
"format": "table",
"title": "Block",
"uniqueItems": true,
"items": {
"type": "object",
"title": "Block",
"properties": {
"above_subline": {
"type": "string"
},
"headline": {
"type": "string"
},
"subline": {
"type": "string"
},
"image_url": {
"type": "string"
},
"text_html": {
"type": "string"
},
"button": {
"type": "string"
}
}
}
}
}
}
```
*Icon Slider Widget*
----------------
```
{
"title": "Icon Slider Widget",
"type": "object",
"properties": {
"above_subline": {
"type": "string"
},
"headline": {
"type": "string"
},
"subline": {
"type": "string"
},
"blocks": {
"type": "array",
"format": "table",
"title": "Icons",
"uniqueItems": true,
"items": {
"type": "object",
"title": "Icons",
"properties": {
"picture_url": {
"type": "string",
"format": "url"
}
}
}
}
}
}
```
*Slider Widget*
---------------
```
{
"title": "Slider Widget",
"type": "object",
"properties": {
"slides": {
"type": "array",
"format": "table",
"title": "Slides",
"uniqueItems": true,
"items": {
"type": "object",
"title": "Slide",
"properties": {
"above_subline": {
"type": "string"
},
"picture_url": {
"type": "string",
"format": "url"
},
"headline": {
"type": "string"
},
"subline": {
"type": "string"
},
"text_html": {
"type": "string",
"format": "html",
"options": {
"wysiwyg": true
}
}
}
}
}
}
}
```
*Video Background Widget*
----------------
```
{
"title": "Video Background Widget",
"type": "object",
"properties": {
"youtube_id": {
"type": "string"
},
"above_subline": {
"type": "string"
},
"picture_url": {
"type": "string",
"format": "url"
},
"headline": {
"type": "string"
},
"subline": {
"type": "string"
},
"button": {
"type": "string"
}
}
}
```
*Gallery Widget*
----------------
```
{
"title": "Gallery Widget",
"type": "object",
"properties": {
"blocks": {
"type": "array",
"format": "table",
"title": "Images",
"uniqueItems": true,
"items": {
"type": "object",
"title": "Image",
"properties": {
"picture_url": {
"type": "string",
"format": "html"
},
"text_html": {
"type": "string",
"format": "html",
"options": {
"wysiwyg": true
}
}
}
}
}
}
}
``` yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/ 0000775 0000000 0000000 00000000000 13022412037 0024514 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/Module.php 0000664 0000000 0000000 00000000674 13022412037 0026461 0 ustar 00root root 0000000 0000000 controller->view->params['breadcrumbs'][] = ['label' => 'Widget module', 'url' => ['/widgets']];
return true;
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/assets/ 0000775 0000000 0000000 00000000000 13022412037 0026016 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/assets/WidgetAsset.php 0000664 0000000 0000000 00000000661 13022412037 0030755 0 ustar 00root root 0000000 0000000 search([]);
return $this->render('index', ['templatesDataProvider' => $dataProvider]);
}
}
TestController.php 0000664 0000000 0000000 00000000431 13022412037 0032475 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/controllers render('index.twig');
}
public function actionWithParam()
{
return $this->render('index.twig');
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/controllers/crud/ 0000775 0000000 0000000 00000000000 13022412037 0030017 5 ustar 00root root 0000000 0000000 WidgetController.php 0000664 0000000 0000000 00000002063 13022412037 0033741 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/controllers/crud load($_POST) && $model->save()) {
return $this->redirect(Url::previous());
} elseif (!\Yii::$app->request->isPost) {
$model->load($_GET);
}
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2])) ? $e->errorInfo[2] : $e->getMessage();
$model->addError('_exception', $msg);
}
return $this->render('create', ['model' => $model]);
}
}
WidgetTemplateController.php 0000664 0000000 0000000 00000000446 13022412037 0035440 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/controllers/crud [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
/*
*
*/
'matchCallback' => function ($rule, $action) {
return \Yii::$app->user->can($this->module->id.'_'.$this->id.'_'.$action->id,
['route' => true]);
},
],
],
],
]
);
}
}
WidgetTemplateController.php 0000664 0000000 0000000 00000002335 13022412037 0036210 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/controllers/crud/api [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
/*
*
*/
'matchCallback' => function ($rule, $action) {
return \Yii::$app->user->can($this->module->id.'_'.$this->id.'_'.$action->id,
['route' => true]);
},
],
],
],
]
);
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/controllers/crud/base/ 0000775 0000000 0000000 00000000000 13022412037 0030731 5 ustar 00root root 0000000 0000000 WidgetController.php 0000664 0000000 0000000 00000010666 13022412037 0034663 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/controllers/crud/base search($_GET);
Tabs::clearLocalStorage();
\Yii::$app->session['__crudReturnUrl'] = null;
return $this->render('index', [
'dataProvider' => $dataProvider,
'searchModel' => $searchModel,
]);
}
/**
* Displays a single Widget model.
*
* @param int $id
*
* @return mixed
*/
public function actionView($id)
{
\Yii::$app->session['__crudReturnUrl'] = Url::previous();
Tabs::rememberActiveState();
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Widget model.
* If creation is successful, the browser will be redirected to the 'view' page.
*
* @return mixed
*/
public function actionCreate()
{
$model = new WidgetContent();
try {
if ($model->load($_POST) && $model->save()) {
if (Url::previous($model->route)) {
return $this->redirect(Url::previous($model->route));
} else {
return $this->redirect(['view', 'id'=>$model->id]);
}
} elseif (!\Yii::$app->request->isPost) {
$model->load($_GET);
}
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2])) ? $e->errorInfo[2] : $e->getMessage();
$model->addError('_exception', $msg);
}
return $this->render('create', ['model' => $model]);
}
/**
* Updates an existing Widget model.
* If update is successful, the browser will be redirected to the 'view' page.
*
* @param int $id
*
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load($_POST) && $model->save() && Url::previous($model->route)) {
return $this->redirect(Url::previous($model->route));
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Widget model.
* If deletion is successful, the browser will be redirected to the 'index' page.
*
* @param int $id
*
* @return mixed
*/
public function actionDelete($id)
{
try {
$model = $this->findModel($id);
$redirectUrl = $model->route;
$model->delete();
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2])) ? $e->errorInfo[2] : $e->getMessage();
\Yii::$app->getSession()->addFlash('error', $msg);
return $this->redirect(Url::previous());
}
if (Url::previous($redirectUrl)) {
return $this->redirect(Url::previous($redirectUrl));
} else {
return $this->redirect(['index']);
}
}
/**
* Finds the Widget model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
*
* @throws HttpException if the model cannot be found
*
* @param int $id
*
* @return WidgetContent the loaded model
*/
protected function findModel($id)
{
if (($model = WidgetContent::findOne($id)) !== null) {
return $model;
} else {
throw new HttpException(404, 'The requested page does not exist.');
}
}
}
WidgetTemplateController.php 0000664 0000000 0000000 00000011206 13022412037 0036346 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/controllers/crud/base search($_GET);
Tabs::clearLocalStorage();
#Url::remember();
\Yii::$app->session['__crudReturnUrl'] = null;
return $this->render('index', [
'dataProvider' => $dataProvider,
'searchModel' => $searchModel,
]);
}
/**
* Displays a single WidgetTemplate model.
*
* @param int $id
*
* @return mixed
*/
public function actionView($id)
{
\Yii::$app->session['__crudReturnUrl'] = Url::previous();
#Url::remember();
Tabs::rememberActiveState();
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new WidgetTemplate model.
* If creation is successful, the browser will be redirected to the 'view' page.
*
* @return mixed
*/
public function actionCreate()
{
$model = new WidgetTemplate();
try {
if ($model->load($_POST) && $model->save()) {
return $this->redirect('index');
} elseif (!\Yii::$app->request->isPost) {
$model->load($_GET);
}
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2])) ? $e->errorInfo[2] : $e->getMessage();
$model->addError('_exception', $msg);
}
return $this->render('create', ['model' => $model]);
}
/**
* Updates an existing WidgetTemplate model.
* If update is successful, the browser will be redirected to the 'view' page.
*
* @param int $id
*
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load($_POST) && $model->save()) {
return $this->redirect(['view', 'id'=>$model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing WidgetTemplate model.
* If deletion is successful, the browser will be redirected to the 'index' page.
*
* @param int $id
*
* @return mixed
*/
public function actionDelete($id)
{
try {
$this->findModel($id)->delete();
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2])) ? $e->errorInfo[2] : $e->getMessage();
\Yii::$app->getSession()->addFlash('error', $msg);
return $this->redirect(Url::previous());
}
// TODO: improve detection
$isPivot = strstr('$id', ',');
if ($isPivot == true) {
return $this->redirect(Url::previous());
} elseif (isset(\Yii::$app->session['__crudReturnUrl']) && \Yii::$app->session['__crudReturnUrl'] != '/') {
Url::remember(null);
$url = \Yii::$app->session['__crudReturnUrl'];
\Yii::$app->session['__crudReturnUrl'] = null;
return $this->redirect($url);
} else {
return $this->redirect(['index']);
}
}
/**
* Finds the WidgetTemplate model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
*
* @throws HttpException if the model cannot be found
*
* @param int $id
*
* @return WidgetTemplate the loaded model
*/
protected function findModel($id)
{
if (($model = WidgetTemplate::findOne($id)) !== null) {
return $model;
} else {
throw new HttpException(404, 'The requested page does not exist.');
}
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/migrations/ 0000775 0000000 0000000 00000000000 13022412037 0026670 5 ustar 00root root 0000000 0000000 m160401_152059_add_widget_table.php 0000664 0000000 0000000 00000003377 13022412037 0034413 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/migrations createTable('{{%hrzg_widget_template}}', [
'id' => 'pk',
'name' => 'VARCHAR(255) NOT NULL',
'php_class' => 'VARCHAR(255) NOT NULL',
'json_schema' => 'TEXT NOT NULL',
'twig_template' => 'TEXT NULL',
]);
$this->createTable('{{%hrzg_widget_content}}', [
'id' => 'pk',
'status' => 'VARCHAR(32) NOT NULL',
'name_id' => 'VARCHAR(64) NULL DEFAULT NULL',
'widget_template_id' => 'INT(11) NOT NULL',
'default_properties_json' => 'TEXT NULL DEFAULT NULL',
'route' => 'VARCHAR(128) NOT NULL',
'request_param' => 'VARCHAR(255) NULL',
'container_id' => 'VARCHAR(128) NOT NULL',
'rank' => 'VARCHAR(11) NOT NULL DEFAULT "0"',
'access_owner' => 'VARCHAR(11) NULL DEFAULT NULL',
'access_domain' => 'VARCHAR(8) NULL DEFAULT NULL',
'access_read' => 'VARCHAR(255) NULL DEFAULT NULL',
'access_update' => 'VARCHAR(255) NULL DEFAULT NULL',
'access_delete' => 'VARCHAR(255) NULL DEFAULT NULL',
'created_at' => 'DATETIME NULL DEFAULT NULL',
'updated_at' => 'DATETIME NULL DEFAULT NULL',
]);
$this->addForeignKey(
'fk_widget_widget_template_id',
'{{%hrzg_widget_content}}',
'widget_template_id',
'{{%hrzg_widget_template}}',
'id',
'RESTRICT',
'RESTRICT');
}
public function down()
{
$this->dropTable('{{%hrzg_widget_content}}');
$this->dropTable('{{%hrzg_widget_template}}');
}
}
m160401_152910_add_widget_auth_item.php 0000664 0000000 0000000 00000002405 13022412037 0035266 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/migrations authManager;
if ($auth instanceof \yii\rbac\DbManager) {
$permission1 = $auth->createPermission('widget_crud_widget');
$permission1->description = 'widget CRUD';
$auth->add($permission1);
$permission2 = $auth->createPermission('widget_widget');
$permission2->description = 'widget CRUD (JSON Data)';
$auth->add($permission2);
$widget = $auth->createPermission('widget');
$widget->description = 'widget Module';
$auth->add($widget);
$auth->addChild($widget, $permission1);
$auth->addChild($widget, $permission2);
}
}
public function down()
{
$auth = Yii::$app->authManager;
if ($auth instanceof \yii\rbac\DbManager) {
$auth->remove($auth->getPermission('widget_widget'));
$auth->remove($auth->getPermission('widget_widget'));
$auth->remove($auth->getChildren('widget'));
} else {
throw new \yii\base\Exception('Application authManager must be an instance of \yii\rbac\DbManager');
}
}
}
m160624_011345_settings.php 0000664 0000000 0000000 00000000636 13022412037 0033003 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/migrations settings->set('availablePhpClasses', '{"hrzg\\\widget\\\widgets\\\TwigTemplate": "Twig layout"}', 'widgets', 'object');
return true;
}
public function down()
{
Yii::$app->settings->delete('availablePhpClasses', 'widgets');
return true;
}
}
m161118_101348_alter_charset_to_utf8.php 0000664 0000000 0000000 00000001113 13022412037 0035424 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/migrations db->createCommand("ALTER TABLE {{%hrzg_widget_content}} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci ;")
->execute();
Yii::$app->db->createCommand("ALTER TABLE {{%hrzg_widget_template}} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci ;")
->execute();
}
public function down()
{
echo "m160721_101347_alter_charset_to_utf8 cannot be reverted.\n";
return false;
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/ 0000775 0000000 0000000 00000000000 13022412037 0025777 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/ 0000775 0000000 0000000 00000000000 13022412037 0026734 5 ustar 00root root 0000000 0000000 WidgetContent.php 0000664 0000000 0000000 00000003446 13022412037 0032153 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud '/^[a-z0-9-]*$/i']
]
);
}
/**
* Global route needs empty request param
* @param bool $insert
*
* @return bool
*/
public function beforeSave($insert)
{
parent::beforeSave($insert);
if ($this->route === Cell::GLOBAL_ROUTE) {
$this->request_param = Cell::EMPTY_REQUEST_PARAM;
}
return true;
}
/**
* @return array
*/
public static function optsWidgetTemplateId()
{
return ArrayHelper::merge(
['' => 'none'],
\yii\helpers\ArrayHelper::map(WidgetTemplate::find()->orderBy('name')->all(), 'id', 'name')
);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getTemplate()
{
return $this->hasOne(WidgetTemplate::className(), ['id' => 'widget_template_id']);
}
/**
* @return string
*/
public function getViewFile()
{
$file = '/'.\Yii::getAlias('@runtime').'/'.md5($this->template->twig_template).'.twig';
file_put_contents($file, $this->template->twig_template);
return $file;
}
}
WidgetTemplate.php 0000664 0000000 0000000 00000003335 13022412037 0032311 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud $attribute);
} catch (InvalidParamException $e) {
$this->addError($attribute, 'Invalid JSON: '.$e->getMessage());
}
},
],
]
);
}
public function optPhpClass()
{
$json = Yii::$app->settings->get('availablePhpClasses', 'widgets', []);
if (!isset($json->scalar)) {
return [];
}
return Json::decode($json->scalar);
}
/**
* Format json_schema before saving to database
* @param string $json_schema
*/
public function beforeSave($insert) {
$data = json_decode($this->json_schema);
$this->json_schema = json_encode($data, JSON_PRETTY_PRINT);
return parent::beforeSave($insert);
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/base/ 0000775 0000000 0000000 00000000000 13022412037 0027646 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/base/Widget.php0000664 0000000 0000000 00000011136 13022412037 0031604 0 ustar 00root root 0000000 0000000 32],
[['widget_template_id', 'container_id', 'route'], 'string', 'max' => 128],
[['name_id'], 'string', 'max' => 64],
[['rank', 'access_owner'], 'string', 'max' => 11],
[['request_param', 'access_read', 'access_update', 'access_delete'], 'string', 'max' => 255],
[['access_domain'], 'string', 'max' => 8],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => Yii::t('widgets', 'ID'),
'status' => Yii::t('widgets', 'Status'),
'widget_template_id' => Yii::t('widgets', 'Template'),
'default_properties_json' => Yii::t('widgets', 'Widget Properties'),
'name_id' => Yii::t('widgets', 'Name ID'),
'container_id' => Yii::t('widgets', 'Container ID'),
'rank' => Yii::t('widgets', 'Rank'),
'route' => Yii::t('widgets', 'Route'),
'request_param' => Yii::t('widgets', 'Request Param'),
'access_owner' => Yii::t('widgets', 'Access Owner'),
'access_domain' => Yii::t('widgets', 'Access Domain'),
'access_read' => Yii::t('widgets', 'Access Read'),
'access_update' => Yii::t('widgets', 'Access Update'),
'access_delete' => Yii::t('widgets', 'Access Delete'),
'created_at' => Yii::t('widgets', 'Created At'),
'updated_at' => Yii::t('widgets', 'Updated At'),
];
}
/*
* @inheritdoc
*/
/*public function attributeHints()
{
return array_merge(
parent::attributeHints(),
[
'id' => Yii::t('widgets', 'ID'),
'status' => Yii::t('widgets', 'Status'),
'widget_template_id' => Yii::t('widgets', 'Class Name'),
'default_properties_json' => Yii::t('widgets', 'Default Properties Json'),
'name_id' => Yii::t('widgets', 'Name Id'),
'container_id' => Yii::t('widgets', 'Container Id'),
'rank' => Yii::t('widgets', 'Rank'),
'route' => Yii::t('widgets', 'Route'),
'request_param' => Yii::t('widgets', 'Request Param'),
'access_owner' => Yii::t('widgets', 'Access Owner'),
'access_domain' => Yii::t('widgets', 'Access Domain'),
'access_read' => Yii::t('widgets', 'Access Read'),
'access_update' => Yii::t('widgets', 'Access Update'),
'access_delete' => Yii::t('widgets', 'Access Delete'),
'created_at' => Yii::t('widgets', 'Created At'),
'updated_at' => Yii::t('widgets', 'Updated At'),
]);
}*/
}
WidgetTemplate.php 0000664 0000000 0000000 00000004376 13022412037 0033231 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/base 255],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => Yii::t('widgets', 'ID'),
'name' => Yii::t('widgets', 'Name'),
'json_schema' => Yii::t('widgets', 'Json Schema'),
'twig_template' => Yii::t('widgets', 'Twig Template'),
];
}
/**
* {@inheritdoc}
*/
public function attributeHints()
{
return array_merge(
parent::attributeHints(),
[
'id' => Yii::t('widgets', 'ID'),
'name' => Yii::t('widgets', 'Name'),
'json_schema' => Yii::t('widgets', 'Json Schema'),
'twig_template' => Yii::t('widgets', 'Template'),
]);
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/query/ 0000775 0000000 0000000 00000000000 13022412037 0030101 5 ustar 00root root 0000000 0000000 WidgetQuery.php 0000664 0000000 0000000 00000001307 13022412037 0033005 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/query andWhere('[[status]]=1');
return $this;
}*/
/**
* {@inheritdoc}
*
* @return \hrzg\widget\models\crud\WidgetContent[]|array
*/
public function all($db = null)
{
return parent::all($db);
}
/**
* {@inheritdoc}
*
* @return \hrzg\widget\models\crud\WidgetContent|array|null
*/
public function one($db = null)
{
return parent::one($db);
}
}
WidgetTemplateQuery.php 0000664 0000000 0000000 00000001341 13022412037 0034477 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/query andWhere('[[status]]=1');
return $this;
}*/
/**
* {@inheritdoc}
*
* @return \hrzg\widget\models\crud\WidgetTemplate[]|array
*/
public function all($db = null)
{
return parent::all($db);
}
/**
* {@inheritdoc}
*
* @return \hrzg\widget\models\crud\WidgetTemplate|array|null
*/
public function one($db = null)
{
return parent::one($db);
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/search/ 0000775 0000000 0000000 00000000000 13022412037 0030201 5 ustar 00root root 0000000 0000000 WidgetContent.php 0000664 0000000 0000000 00000006120 13022412037 0033410 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/search $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
$query->andFilterWhere([
'id' => $this->id,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'status', $this->status])
->andFilterWhere(['like', 'widget_template_id', $this->widget_template_id])
->andFilterWhere(['like', 'default_properties_json', $this->default_properties_json])
->andFilterWhere(['like', 'name_id', $this->name_id])
->andFilterWhere(['like', 'container_id', $this->container_id])
->andFilterWhere(['like', 'rank', $this->rank])
->andFilterWhere(['like', 'route', $this->route])
->andFilterWhere(['like', 'request_param', $this->request_param])
->andFilterWhere(['like', 'access_owner', $this->access_owner])
->andFilterWhere(['like', 'access_domain', $this->access_domain])
->andFilterWhere(['like', 'access_read', $this->access_read])
->andFilterWhere(['like', 'access_update', $this->access_update])
->andFilterWhere(['like', 'access_delete', $this->access_delete]);
return $dataProvider;
}
}
WidgetTemplate.php 0000664 0000000 0000000 00000003426 13022412037 0033557 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/models/crud/search $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
$query->andFilterWhere([
'id' => $this->id,
]);
$query->andFilterWhere(['like', 'name', $this->name])
->andFilterWhere(['like', 'json_schema', $this->json_schema])
->andFilterWhere(['like', 'twig_template', $this->twig_template]);
$query->orderBy('name');
return $dataProvider;
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/traits/ 0000775 0000000 0000000 00000000000 13022412037 0026022 5 ustar 00root root 0000000 0000000 ActiveRecordDbConnectionTrait.php 0000664 0000000 0000000 00000000234 13022412037 0034317 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/traits db;
}
}
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/ 0000775 0000000 0000000 00000000000 13022412037 0025651 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/ 0000775 0000000 0000000 00000000000 13022412037 0026606 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget-template/0000775 0000000 0000000 00000000000 13022412037 0031702 5 ustar 00root root 0000000 0000000 _form.php 0000664 0000000 0000000 00000004574 13022412037 0033450 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget-template
_search.php 0000664 0000000 0000000 00000001610 13022412037 0033736 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget-template
create.php 0000664 0000000 0000000 00000002013 13022412037 0033573 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget-template title = Yii::t('widgets', 'Create');
$this->params['breadcrumbs'][] = ['label' => $model->getAliasModel(true), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
index.php 0000664 0000000 0000000 00000005210 13022412037 0033441 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget-template title = $searchModel->getAliasModel(true);
$this->params['breadcrumbs'][] = $this->title;
?>
update.php 0000664 0000000 0000000 00000002176 13022412037 0033624 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget-template title = $model->getAliasModel().$model->name.', '.Yii::t('widgets', 'Edit');
$this->params['breadcrumbs'][] = ['label' => $model->getAliasModel(true), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => (string) $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('widgets', 'Edit');
?>
view.php 0000664 0000000 0000000 00000007230 13022412037 0033310 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget-template attributes;
$this->title = $model->getAliasModel().$model->name;
$this->params['breadcrumbs'][] = ['label' => $model->getAliasModel(true), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => (string) $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('widgets', 'View');
?>
session->getFlash('deleteError') !== null) : ?>
session->getFlash('deleteError') ?>
getAliasModel() ?>
name ?>
'.Yii::t('widgets', 'Edit'),
['update', 'id' => $model->id], ['class' => 'btn btn-info']) ?>
'.Yii::t('widgets', 'Copy'),
['create', 'id' => $model->id, 'WidgetTemplate' => $copyParams],
['class' => 'btn btn-success']) ?>
'.Yii::t('widgets', 'New'), ['create'],
['class' => 'btn btn-success']) ?>
'.Yii::t('widgets', 'Full list'), ['index'],
['class' => 'btn btn-default']) ?>
beginBlock('hrzg\widget\models\crud\WidgetTemplate'); ?>
$model,
'attributes' => [
'id',
'name',
'php_class',
[
'attribute' => 'json_schema',
'format' => 'html',
'value' => '
'.Html::encode($model->json_schema).'
'
],
[
'attribute' => 'twig_template',
'format' => 'html',
'value' => '
'.Html::encode($model->twig_template).'
'
],
],
]); ?>
'.Yii::t('widgets', 'Delete'),
['delete', 'id' => $model->id],
[
'class' => 'btn btn-danger',
'data-confirm' => ''.Yii::t('widgets', 'Are you sure to delete this item?').'',
'data-method' => 'post',
]); ?>
endBlock(); ?>
'relation-tabs',
'encodeLabels' => false,
'items' => [
[
'label' => '
# '.$model->id.'',
'content' => $this->blocks['hrzg\widget\models\crud\WidgetTemplate'],
'active' => true,
],
],
]
);
?>
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget/ 0000775 0000000 0000000 00000000000 13022412037 0030071 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget/_form.php0000664 0000000 0000000 00000012723 13022412037 0031711 0 ustar 00root root 0000000 0000000
_search.php 0000664 0000000 0000000 00000003077 13022412037 0032136 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget
create.php 0000664 0000000 0000000 00000001771 13022412037 0031774 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget title = Yii::t('widgets', 'Create');
$this->params['breadcrumbs'][] = ['label' => $model->getAliasModel(true), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget/index.php0000664 0000000 0000000 00000006142 13022412037 0031714 0 ustar 00root root 0000000 0000000 title = $searchModel->getAliasModel(true);
$this->params['breadcrumbs'][] = $this->title;
?>
render('_search', ['model' =>$searchModel]);
?>
'pjax-main',
'enableReplaceState' => false,
'linkSelector' => '#pjax-main ul.pagination a, th a',
'clientOptions' => ['pjax:success' => 'function(){alert("yo")}'],
]) ?>
getAliasModel(true) ?>
List
'.Yii::t('widgets', 'New'), ['create'],
['class' => 'btn btn-success']) ?>
'{summary}{pager}{items}{pager}',
'dataProvider' => $dataProvider,
'pager' => [
'class' => yii\widgets\LinkPager::className(),
'firstPageLabel' => Yii::t('widgets', 'First'),
'lastPageLabel' => Yii::t('widgets', 'Last'),
],
'filterModel' => $searchModel,
'tableOptions' => ['class' => 'table table-striped table-bordered table-hover'],
'headerRowOptions' => ['class' => 'x'],
'columns' => [
[
'class' => 'yii\grid\ActionColumn',
'urlCreator' => function ($action, $model, $key, $index) {
// using the column name as key, not mapping to 'id' like the standard generator
$params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
$params[0] = \Yii::$app->controller->id ? \Yii::$app->controller->id.'/'.$action : $action;
return Url::toRoute($params);
},
'contentOptions' => ['nowrap' => 'nowrap'],
],
[
'attribute' => 'template.name',
'header' => 'Template',
'contentOptions' => ['nowrap' => 'nowrap'],
],
'access_domain',
'route',
'request_param',
'container_id',
'name_id',
'rank',
'status',
/*'access_owner',*/
/*'access_read'*/
/*'access_update'*/
/*'access_delete'*/
],
]); ?>
update.php 0000664 0000000 0000000 00000002230 13022412037 0032002 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget title = $model->getAliasModel().$model->id.', '.Yii::t('widgets', 'Edit');
$this->params['breadcrumbs'][] = ['label' => $model->getAliasModel(true), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => (string) $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('widgets', 'Edit');
?>
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/crud/widget/view.php 0000664 0000000 0000000 00000010074 13022412037 0031556 0 ustar 00root root 0000000 0000000 attributes;
$this->title = $model->getAliasModel().$model->id;
$this->params['breadcrumbs'][] = ['label' => $model->getAliasModel(true), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => (string) $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = \Yii::t('widgets', 'View');
?>
session->getFlash('deleteError') !== null) : ?>
session->getFlash('deleteError') ?>
getAliasModel() ?>
name_id ?>
'.\Yii::t('widgets', 'Edit'),
['update', 'id' => $model->id], ['class' => 'btn btn-info']) ?>
'.\Yii::t('widgets', 'Copy'),
['create', 'id' => $model->id, 'Widget' => $copyParams], ['class' => 'btn btn-success']) ?>
'.\Yii::t('widgets', 'New'), ['create'],
['class' => 'btn btn-success']) ?>
'.\Yii::t('widgets', 'Full list'), ['index'],
['class' => 'btn btn-default']) ?>
beginBlock('hrzg\widget\models\crud\Widget'); ?>
['class' => 'table table-striped table-bordered detail-view'],
'model' => $model,
'attributes' => [
'id',
'status',
[
'attribute' => 'widget_template_id',
'format' => 'raw',
'value' => \yii\helpers\Html::a($model->template->name, ['crud/widget-template/view', 'id'=>$model->widget_template_id])
],
[
'attribute' => 'default_properties_json',
'format' => 'raw',
'value' => "
".Html::encode($model->default_properties_json)."
",
],
'name_id',
'container_id',
'rank',
'route',
'request_param',
'access_owner',
'access_domain',
'access_read',
'access_update',
'access_delete',
'created_at',
'updated_at',
],
]); ?>
'.\Yii::t('widgets', 'Delete'),
['delete', 'id' => $model->id],
[
'class' => 'btn btn-danger',
'data-confirm' => ''.\Yii::t('widgets', 'Are you sure to delete this item?').'',
'data-method' => 'post',
]); ?>
endBlock(); ?>
'relation-tabs',
'encodeLabels' => false,
'items' => [
[
'label' => '
# '.$model->id.'',
'content' => $this->blocks['hrzg\widget\models\crud\Widget'],
'active' => true,
],
],
]
);
?>
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/default/ 0000775 0000000 0000000 00000000000 13022412037 0027275 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/default/index.php 0000664 0000000 0000000 00000004006 13022412037 0031115 0 ustar 00root root 0000000 0000000
= \insolita\wgadminlte\SmallBox::widget(
[
'head' => WidgetContent::find()->count(),
'footer' => 'Widget Contents',
'footer_link' => ['crud/widget'],
]
) ?>
= \insolita\wgadminlte\SmallBox::widget(
[
'head' => WidgetTemplate::find()->count(),
'type' => SmallBox::TYPE_PURPLE,
'footer' => 'Templates',
'footer_link' => ['crud/widget-template'],
]
) ?>
= \insolita\wgadminlte\SmallBox::widget(
[
'head' => '+',
'type' => SmallBox::TYPE_GREEN,
'footer' => 'New template',
'footer_link' => ['crud/widget-template/create'],
]
) ?>
widgets
availablePhpClasses
JSON
Example
{"hrzg\\widget\\widgets\\TwigTemplate": "Twig layout"}
= Html::a('Open settings', ['/settings'], ['class' => 'btn btn-default']) ?>
= Html::a('Online documentation', 'https://git.hrzg.de/hrzg/yii2-widgets2-module', ['class' => 'btn btn-info']) ?>
= Html::a('Test page index', ['test/index'], ['class' => 'btn btn-default']) ?>
= Html::a('Test page-1 (with parameter)', ['test/with-param', 'pageId' => 'page-1'], ['class' => 'btn btn-default']) ?>
= Html::a('Test page-2 (with parameter)', ['test/with-param', 'pageId' => 'page-2'], ['class' => 'btn btn-default']) ?>
yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/layouts/ 0000775 0000000 0000000 00000000000 13022412037 0027351 5 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/layouts/box.php 0000664 0000000 0000000 00000000757 13022412037 0030663 0 ustar 00root root 0000000 0000000
beginContent('@backend/views/layouts/main.php'); ?>
endContent(); ?> yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/test/ 0000775 0000000 0000000 00000000000 13022412037 0026630 5 ustar 00root root 0000000 0000000 header-container.twig 0000664 0000000 0000000 00000000214 13022412037 0032652 0 ustar 00root root 0000000 0000000 yii2-widgets2-module-master-20cc113446c46a59f17ab4f3dbb904bc7c3c663d/src/views/test {{ use ('hrzg/widget/widgets') }}
{{ cell_widget({id: 'header'}) }}
{{ cell_widget({id: 'container'}) }}