Welcome Guest, Not a member yet? Register   Sign In
New Registrar Feature
#1

(This post was last modified: 10-22-2023, 06:40 PM by donpwinston.)

I'm looking for a way to modify config information without modifying the app/Config/* files. I don't believe I can do all that I want in the .env file. 
For example how would I do this:
PHP Code:
public array $globals = [
        'before' => [
            // 'honeypot',
            // 'csrf',
            // 'invalidchars',
        ],
        'after' => [
            'toolbar',
            // 'honeypot',
            'csrf' => ['except' => ['receive-pdf''receive_pdf']],
            // 'secureheaders',
        ],
    ]; 

Problematic config files for me are Routes.php(not a subclass of BaseConfig), Validation.php, and Filters.php.
When looking around I noticed the new Registrar feature. I'm interested in the implicit way of using this but I don't understand the following:
PHP Code:
<?php

namespace CodeIgniter\Shield\Config;

class 
Registrar
{
    public static function Pager(): array
    {
        return [
            'templates' => [
                'module_pager' => 'MyModule\Views\Pager',
            ],
        ];
    }


What is this CodeIgniter\Shield\Config namespace?

I'm annoyed at having to diff my config files with any new CI upgrade and merge all my changes back into the file after upgrading. There's got to be a better way to do this. The config part should not be affected by upgrades. The config information should be in a non php file like .env and loaded when the app starts or set the class properties in some sort of start up function somewhere. How can I modify the Config classes properties dynamically? I believe I can create my own Config class say MyApp.php. A CI upgrade would not overwrite my config class. In this class can I set the property values of other Config classes? That would mean MyApp.php would have to be evaluated last.
Simpler is always better
Reply


Messages In This Thread
New Registrar Feature - by donpwinston - 10-22-2023, 06:36 PM
RE: New Registrar Feature - by InsiteFX - 10-22-2023, 09:57 PM
RE: New Registrar Feature - by kenjis - 10-22-2023, 10:06 PM
RE: New Registrar Feature - by donpwinston - 10-23-2023, 02:49 AM
RE: New Registrar Feature - by donpwinston - 10-28-2023, 12:21 AM
RE: New Registrar Feature - by kenjis - 10-22-2023, 10:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB