Retrieve Plugin Data #kirby #php
Eg. get a blueprint or a template path in a controller:
// index.php
Kirby::plugin('my/plugin', [
'blueprints' => [
'profile_form' => __DIR__ . '/blueprints/form.yml',Retrieve Plugin Data #kirby #php
Eg. get a blueprint or a template path in a controller:
// index.php
Kirby::plugin('my/plugin', [
'blueprints' => [
'profile_form' => __DIR__ . '/blueprints/form.yml',Set into [mysqld] of MySQL config, for Ubuntu your could create a file /etc/mysql/conf.d/disable_strict_mode.cnf:
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION
SQL mode example:
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
| <?php | |
| $blueprint = new Kirby\Cms\PageBlueprint(array_merge(['model' => $page], Kirby\Cms\Blueprint::load('pages/album'))); | |
| dump($blueprint->section('images')); |
| <?php | |
| $csv = fopen('php://memory', 'r+'); | |
| fputcsv($csv, ['a','b','c'], "\t"); | |
| fputcsv($csv, ['a','b','c'], "\t"); | |
| rewind($csv); | |
| $output = stream_get_contents($csv); | |
| // tab as string |
let handle = function (event) {
if(event.detail.elt.id !== 'formFilter'){
return;
}
event.detail.path = event.detail.parameters['categories'];
delete event.detail.parameters['categories'];
};
document.body.addEventListener("htmx:configRequest", handle);| <?php | |
| namespace Kevinrob\GuzzleCache\Storage; | |
| use Kevinrob\GuzzleCache\CacheEntry; | |
| class KirbyCacheStorage implements CacheStorageInterface | |
| { | |
| /** |
| <form> | |
| <input class="kb-field-2"> | |
| <button class="kb-forms-submit">A</button> | |
| </form> | |
| <script> | |
| const field = document.getElementsByClassName('kb-field-2')[0]; | |
| field.addEventListener("keyup", () => { | |
| let btn = document.getElementsByClassName('kb-forms-submit')[0]; | |
| if( field.value === "" ) { |