Skip to content

Commit c6f4ef3

Browse files
committed
changed documentation
1 parent d9c352d commit c6f4ef3

File tree

1 file changed

+29
-22
lines changed

1 file changed

+29
-22
lines changed

README.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,32 @@ Usage:
2020
include('Embed/autoloader.php');
2121

2222
//Load any url:
23-
$Url = new Embed\Url('https://www.youtube.com/watch?v=PP1xn5wHtxE');
24-
$Info = Embed\Embed::create($Url);
23+
$info = Embed\Embed::create('https://www.youtube.com/watch?v=PP1xn5wHtxE');
2524

2625
//Get content info
2726

28-
$Info->title;
29-
$Info->description;
30-
$Info->url;
31-
$Info->type;
27+
$info->title;
28+
$info->description;
29+
$info->url;
30+
$info->type;
3231

33-
$Info->images;
34-
$Info->image;
35-
$Info->imageWidth;
36-
$Info->imageHeight;
32+
$info->images;
33+
$info->image;
34+
$info->imageWidth;
35+
$info->imageHeight;
3736

38-
$Info->code;
39-
$Info->width;
40-
$Info->height;
41-
$Info->aspectRatio;
37+
$info->code;
38+
$info->width;
39+
$info->height;
40+
$info->aspectRatio;
4241

43-
$Info->authorName;
44-
$Info->authorUrl;
42+
$info->authorName;
43+
$info->authorUrl;
4544

46-
$Info->providerIcons;
47-
$Info->providerIcon;
48-
$Info->providerName;
49-
$Info->providerUrl;
45+
$info->providerIcons;
46+
$info->providerIcon;
47+
$info->providerName;
48+
$info->providerUrl;
5049
```
5150

5251
Available options
@@ -65,9 +64,17 @@ $options = array(
6564
'getBiggerImage' => true
6665
);
6766

68-
$Url = new Embed\Url('https://www.youtube.com/watch?v=PP1xn5wHtxE');
67+
$info = Embed\Embed::create('https://www.youtube.com/watch?v=PP1xn5wHtxE', $options);
68+
```
69+
70+
Customize the request
71+
---------------------
6972

70-
$Info = Embed\Embed::create($Url, $options);
73+
Embed provides a RequestResolvers\Curl class to resolve all requests using the curl library. You can create your own request resolver class creating a class implementing the RequestResolverInterface.
74+
75+
```php
76+
//Configure the request resolver class:
77+
Embed\Request::setDefaultResolver('MyCustomResolverClass');
7178
```
7279

7380

0 commit comments

Comments
 (0)