/** * An array of the types that have been resolved. * * @var array */protected $resolved = array();
Read the Laravel source of the time to see.
Located in Illuminate\container\container.
Would this resolved be used to mark if the corresponding type name has been parsed?
The translation of resolved in Youdao dictionary.
Adj. A determined, resolved, or decisive
V. To resolve, decide, break down, change (resolve past participle)
Reply content:
/** * An array of the types that have been resolved. * * @var array */protected $resolved = array();
Read the Laravel source of the time to see.
Located in Illuminate\container\container.
Would this resolved be used to mark if the corresponding type name has been parsed?
The translation of resolved in Youdao dictionary.
Adj. A determined, resolved, or decisive
V. To resolve, decide, break down, change (resolve past participle)
Would this resolved be used to mark if the corresponding type name has been parsed?
Oh, yes.
You track down this variable.
public function make($abstract, $parameters = array()){ $abstract = $this->getAlias($abstract); $this->resolved[$abstract] = true;
It seems that this is the only place where the entire frame appears ....
It's a counter, it's gone.
View::make(...)
,App::make('foo')
$resolved = array('view'=>true,'foo'=>true);
Estimated to be available for debug purposes?
We know that there are a lot of facade usage in laravel, such as the Router,router::get () you wrote first, do you know why you can write like this? Router::get () is actually equivalent to $app->make (' Router ')->get (); $app->make (' router ') is a very image of the IOC container, $app->make () is the container, ' router ' is put in the parsed class (alias), $app->make (' router ') can be An instance of the route class is parsed out.
You may have to ask, why do you have to parse it? What does parsing mean? Can I get an instance of the new class? First, if you bind a class to the IOC container, it can automatically generate instances for you, without the include, without new. Second, the new class does not directly help you to parse the class it relies on, especially the interface class, with new method you need to create an instance with new, and then pass in this class dependent instance (meaning there are more new).
See more: Service Container (IOC container)