PHP code example of presprog / kirby-php-blueprint-loader
1. Go to this page and download the library: Download presprog/kirby-php-blueprint-loader library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
presprog / kirby-php-blueprint-loader example snippets
// site/blueprints/pages/blueprint.php
$user = kirby()->user();
$fields = [
// Field config for all users
];
if ($user->isAdmin()) {
$fields = [
// Admins should have a separate set of fields
];
}
return [
'title' => 'PHP-based blueprint',
'fields' => $fields,
]