8000 Update README.md · Shintio/yii2-proxy-httpclient@666e4ca · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 666e4ca

Browse files
authored
Update README.md
1 parent 57bb078 commit 666e4ca

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1010
Either run
1111

1212
```
13-
php composer.phar require --prefer-dist shintio/yii2-proxy-httpclient "*"
13+
composer require --prefer-dist shintio/yii2-proxy-httpclient "*"
1414
```
1515

1616
or add
@@ -21,11 +21,25 @@ or add
2121

2222
to the require section of your `composer.json` file.
2323

24+
Apply migrations by following command:
25+
```bash
26+
php yii migrate --migrationPath="vendor/shintio/yii2-proxy-httpclient/src/database/migrations/"
27+
```
2428

2529
Usage
2630
-----
2731

28-
Once the extension is installed, simply use it in your code by :
32+
Once the extension is installed, simply use it in your code like:
2933

3034
```php
31-
<?= \shintio\yii2\proxy\AutoloadExample::widget(); ?>```
35+
use shintio\yii2\proxy\components\Client;
36+
37+
$client = new Client();
38+
39+
$request = $client->createRequest()->setMethod('get')->setUrl('https://2ip.ru/');
40+
41+
$response = $request->send();
42+
43+
echo $response->content;
44+
die;
45+
```

0 commit comments

Comments
 (0)
0