Answer the question
In order to leave comments, you need to log in
Why doesn't Singleton save the parameters written to the property of the object?
Took an example of the Singltone class here , making a small parser. I want to save the path of the uploaded file, read it partially, so that the user can adjust the correspondence between the columns from the file and the directory properties at the second step of parsing (which, by the way, may also need to be stored in an instance of the Parser class). In general, if you do this:
$parser = App\Parser::getInstance();
$parser->setValue('name', 'parserPanel');
$parser2 = App\Parser::getInstance();
echo $parser2->getValue('name'); //тут получаю ранее установленный name, т.е. parserPanel
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question