Answer the question
In order to leave comments, you need to log in
Template Registry OOP?
Good day. Started learning OOP. The question arose:
There is a class APP, it just has a static $App container that returns objects of the Registry class.
You have to contact from the controller like this
use vendor\core\App;
App::$App->NameClass->getUser();
use vendor\core\App;
App::NameClass->getUser();
// или вот так
use vendor\core\App;
App->NameClass->getUser();
<?php
namespace vendor\core;
use vendor\core\Registry;
class App {
public static $App;
public function __construct(){
self::$App = Registry::instance();
}
}
Answer the question
In order to leave comments, you need to log in
How do I get rid of the $App container so that I can call the registry plugins like this:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question