What is meant by the resolved mentioned in the Laravel container.

Source: Internet
Author: User
/** * 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)

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.