Skip to content

Commit 88f5771

Browse files
committed
Replaced IoC
Replacing IoC container to Service Container
1 parent 581956e commit 88f5771

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

facades.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<a name="introduction"></a>
1111
## Introduction
1212

13-
Facades provide a "static" interface to classes that are available in the application's [IoC container](/docs/5.0/container). Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.
13+
Facades provide a "static" interface to classes that are available in the application's [service container](/docs/5.0/container). Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.
1414

1515
Occasionally, you may wish to create your own facades for your application's and packages, so let's explore the concept, development and usage of these classes.
1616

17-
> **Note:** Before digging into facades, it is strongly recommended that you become very familiar with the Laravel [IoC container](/docs/5.0/container).
17+
> **Note:** Before digging into facades, it is strongly recommended that you become very familiar with the Laravel [service container](/docs/5.0/container).
1818
1919
<a name="explanation"></a>
2020
## Explanation
@@ -23,7 +23,7 @@ In the context of a Laravel application, a facade is a class that provides acces
2323

2424
Your facade class only needs to implement a single method: `getFacadeAccessor`. It's the `getFacadeAccessor` method's job to define what to resolve from the container. The `Facade` base class makes use of the `__callStatic()` magic-method to defer calls from your facade to the resolved object.
2525

26-
So, when you make a facade call like `Cache::get`, Laravel resolves the Cache manager class out of the IoC container and calls the `get` method on the class. In technical terms, Laravel Facades are a convenient syntax for using the Laravel IoC container as a service locator.
26+
So, when you make a facade call like `Cache::get`, Laravel resolves the Cache manager class out of the service container and calls the `get` method on the class. In technical terms, Laravel Facades are a convenient syntax for using the Laravel service container as a service locator.
2727

2828
<a name="practical-usage"></a>
2929
## Practical Usage
@@ -45,9 +45,9 @@ However, if we look at that `Illuminate\Support\Facades\Cache` class, you'll see
4545

4646
}
4747

48-
The Cache class extends the base `Facade` class and defines a method `getFacadeAccessor()`. Remember, this method's job is to return the name of an IoC binding.
48+
The Cache class extends the base `Facade` class and defines a method `getFacadeAccessor()`. Remember, this method's job is to return the name of a service container binding.
4949

50-
When a user references any static method on the `Cache` facade, Laravel resolves the `cache` binding from the IoC container and runs the requested method (in this case, `get`) against that object.
50+
When a user references any static method on the `Cache` facade, Laravel resolves the `cache` binding from the service container and runs the requested method (in this case, `get`) against that object.
5151

5252
So, our `Cache::get` call could be re-written like so:
5353

@@ -82,7 +82,7 @@ Remember, if you are using a facade in a controller that is namespaced, you will
8282

8383
Creating a facade for your own application or package is simple. You only need 3 things:
8484

85-
- An IoC binding.
85+
- A service container binding.
8686
- A facade class.
8787
- A facade alias configuration.
8888

@@ -99,7 +99,7 @@ Let's look at an example. Here, we have a class defined as `PaymentGateway\Payme
9999

100100
}
101101

102-
We need to be able to resolve this class from the IoC container. So, let's add a binding to a service provider:
102+
We need to be able to resolve this class from the service container. So, let's add a binding to a service provider:
103103

104104
App::bind('payment', function()
105105
{
@@ -134,9 +134,9 @@ Unit testing is an important aspect of why facades work the way that they do. In
134134
<a name="facade-class-reference"></a>
135135
## Facade Class Reference
136136

137-
Below you will find every facade and its underlying class. This is a useful tool for quickly digging into the API documentation for a given facade root. The [IoC binding](/docs/5.0/container) key is also included where applicable.
137+
Below you will find every facade and its underlying class. This is a useful tool for quickly digging into the API documentation for a given facade root. The [service container binding](/docs/5.0/container) key is also included where applicable.
138138

139-
Facade | Class | IoC Binding
139+
Facade | Class | Service Container Binding
140140
------------- | ------------- | -------------
141141
App | [Illuminate\Foundation\Application](http://laravel.com/api/5.0/Illuminate/Foundation/Application.html) | `app`
142142
Artisan | [Illuminate\Console\Application](http://laravel.com/api/5.0/Illuminate/Console/Application.html) | `artisan`

0 commit comments

Comments
 (0)