since i have been working on the further development of cockpit, i have always had the same problems.
e.g. i can’t find the instances of the classes. actually it’s quite simple. ‘new namespace/classname’ but i can’t reverse analyze the code.
e.g. i wanted to create a new class utils. actually i don’t like the current code, but i’m trying to adapt.
the utils should allow me to make a request via the frontend to get data, just like with collections.
in the Collections this was done with method names.
e.g.
class Utils extends \Cockpit\AuthController {
public function getUserCollections() {
In the browser then e.g.:
http://localhost:8000/collections/utils/getUserCollections
is called. So far all good
Now I want to do the same for singletons. Therefore my thought to pack the utils with methods accordingly in the framework under singletons.
I’ve been browsing the project for days with debugger and global search, but I keep hitting my personal limits.
Translated with DeepL Translate: The world's most accurate translator (free version)
my last idea:
call : GET http://localhost:8000/singletons/utils/test
modify admin.php in dir singletons and add
$this->bindClass('Singletons\\Controller\\Utils', 'singletons/utils');
then make a new Class Utils with contains:
<?php
namespace Singletons\Controller;
class Utils extends \Cockpit\AuthController {
public function test()
{
return 'ok1';
}
}
Call them and get a 404
cant , debug, cant reverse analys, why that not working.
In routing-list. i am not understand, who is the class? overall the same closure