add plugin web2print
This commit is contained in:
parent
1f024a7e71
commit
d3b9220931
17 changed files with 596 additions and 2 deletions
33
site/plugins/web2print/index.php
Normal file
33
site/plugins/web2print/index.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
Kirby::plugin('studio-variable/web2print', [
|
||||
'fields' => [
|
||||
'web2print' => [
|
||||
'props' => [
|
||||
'cssPath' => function($cssPath = null) {
|
||||
return $cssPath;
|
||||
}
|
||||
],
|
||||
'computed' => [
|
||||
'htmlPageString' => function() {
|
||||
return $this->model()->render();
|
||||
},
|
||||
'cssPath' => function() {
|
||||
return $this->cssPath ?? 'assets/css/style.css';
|
||||
},
|
||||
'printFormat' => function() {
|
||||
return $this->model()->printFormat()->value() ?? 'A4';
|
||||
},
|
||||
'pageId' => function() {
|
||||
return $this->model()->id();
|
||||
}
|
||||
]
|
||||
]
|
||||
],
|
||||
'routes' => [
|
||||
require __DIR__ . '/src/routes/web2print.php',
|
||||
],
|
||||
'blueprints' => [
|
||||
'tabs/web2print' => __DIR__ . '/src/blueprints/tabs/web2print.yml'
|
||||
]
|
||||
]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue