Skip to content

Commit 36d81e1

Browse files
authored
update the readme
Add detail to and basic usage.
1 parent eed9eca commit 36d81e1

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ A PHP base class that you can use to upload any file into the server. It is a ve
66

77
Composer installation:
88

9-
`composer require learncodeweb/upload-files-with-image-thumb-and-resizer`
9+
```composer
10+
composer require learncodeweb/upload-files-with-image-thumb-and-resizer
11+
```
1012

1113
----
1214

@@ -23,3 +25,46 @@ A PHP base class that you can use to upload any file into the server. It is a ve
2325
9) Customizable Thumbnails Sizes And Dimensions.
2426
10) Files Extension Filters.
2527
11) File Size Limit for Uploading.
28+
29+
----
30+
31+
How to use after installation:
32+
33+
```php
34+
require('../multi-files-upload-and-image-resizer.php');
35+
$rename = rand(1000, 5000) . time(); // left empty if you want the real file name
36+
$upload = new anyFileUpload\ImageUploadAndResize('array', ['jpeg', 'jpg', 'png'], '../uploads', 0655);
37+
$upload->uploadFiles('files', 250, '', $rename, 100, '850', ['350','450']);
38+
```
39+
40+
/* For watermark you will use array and able to add image as a watermark or text. */
41+
42+
**With text below will be the parameters:**
43+
```php
44+
[
45+
'value' => "HI I AM ZAID",
46+
'font-size' => 50,
47+
'font-family' => "../fonts/Myriad-Pro-Regular.ttf",
48+
'font-color' => '#0a103e',
49+
'position-x' => 400,
50+
'position-y' => 100
51+
];
52+
```
53+
54+
**With image below will be the parameters:**
55+
```php
56+
[
57+
'value' => "your-image-complete-path",
58+
'position-x' => 400,
59+
'position-y' => 100
60+
];
61+
```
62+
63+
**And the response will be get like below:**
64+
In the below response you will get the uploaded/not uploaded/bad extensions and success/error flags array or json data.
65+
66+
```php
67+
print "<pre>";
68+
print_r($upload->uploadedData);
69+
print "</pre>";
70+
```

0 commit comments

Comments
 (0)