# Php user/blueprints not picked up

**URL:** <https://forum.getkirby.com/t/php-user-blueprints-not-picked-up/34356>\
**Category:** Questions\
**Tags:** v5\
**Created:** [July 4, 2025, 1:31pm UTC](https://forum.getkirby.com/t/php-user-blueprints-not-picked-up/34356 "2025-07-04T13:31:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkieMark](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/markiemark/32/14308_2.png) [@MarkieMark](https://forum.getkirby.com/u/MarkieMark)\
**Post date:** [July 4, 2025, 1:31pm UTC](https://forum.getkirby.com/t/php-user-blueprints-not-picked-up/34356/1 "2025-07-04T13:31:05Z")

</div>

OK,

I’m creating a permission plugin and using user(role) blueprints in site/blueprints/users/…  
Like for instance a “viewer” role.

When I use a viewer.yml file I can add this user-role to any user in the control panel when logged in as Admin. But when I use a viewer.php (programmable) blueprint, this one is not picked up in the control panel ie users section, so I cannot apply the viewer-user-role to a user…

Do we have to register these php-blueprints explicitly? I thought Kirby would pick these up automagically?

Thanks in advance again (:-

Example: functioning user-role blueprint site/blueprints/users/viewer.yml:

```auto
title: Viewer
description: Can only view

permissions:
  access:
    panel: true
    settings: false
    users: false
    site: true

```

Non-functioning programmable version site/blueprints/users/viewer.php:

```auto
<?php
// site/blueprints/users/viewer.php

return [
    'title' => 'Viewer (from PHP)',
    'description' => 'This is a test to see if a PHP blueprint can be loaded.',
    'permissions' => [
        'access' => [
            'panel' => true
        ]
    ]
];

```

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [July 4, 2025, 2:06pm UTC](https://forum.getkirby.com/t/php-user-blueprints-not-picked-up/34356/2 "2025-07-04T14:06:35Z")

</div>

you are correct. Kirby will currently only autoload yaml based blueprints. Registering a PHP based blueprint needs to happen within a custom plugin.

```php
<?php

use Kirby\Cms\App as Kirby;

Kirby::plugin('cookbook/programmable-blueprints', [
    'blueprints' => [
       'users/viewer' => [...], // <-- here
       'users/viewer' => require __DIR__. '/path/to/blueprints/users/viewer.php', // <-- or like that
    ]
]);

```

> **[PHP-based blueprints](https://getkirby.com/docs/cookbook/development-deployment/programmable-blueprints#prerequisites)**
>
> Create blueprints programmatically with PHP

Alternatives:

- There is a [plugin to autoload PHP files](https://plugins.getkirby.com/presprog/php-blueprint-loader).
- One to [create them with a fluent class based syntax](https://plugins.getkirby.com/bnomei/blueprints)
- and a [generic helper to autoload various files](https://plugins.getkirby.com/bnomei/autoloader) kirby might need
- and a [2 year old feature suggestion to make PHP work like YAML](https://kirby.nolt.io/572) (as it did in K1 and K2)

---

<div class="post-metadata">

**Author:** ![MarkieMark](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/markiemark/32/14308_2.png) [@MarkieMark](https://forum.getkirby.com/u/MarkieMark)\
**Post date:** [July 4, 2025, 2:08pm UTC](https://forum.getkirby.com/t/php-user-blueprints-not-picked-up/34356/3 "2025-07-04T14:08:34Z")

</div>

Thanks for the quick response!

Solved!
