Skip to content

Commit

Permalink
ex^port documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreLebedel committed Nov 3, 2024
1 parent 1341284 commit 2e270e0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ composer require pleb/vcardio
- [vCards collection](docs/collection.md)
- [vCard builder](docs/builder.md)
- [vCard object](docs/vcard.md)
- [Exporting files](docs/export.md)

## Usage

Expand Down Expand Up @@ -229,17 +230,20 @@ END:VCARD
The existing .vcf file will be overwritten.

```php
echo $vCard->export('./file/export/destination.vcf');
$vCard->export('./file/export/destination.vcf');
```

#### Export vCards collection

The existing .vcf can overwritten or appended.
The existing .vcf can be overwritten or appended.

```php
echo $vCardCollection->export('./file/export/destination.vcf', append:false); // OVERWRITTEN

echo $vCardCollection->export('./file/export/destination.vcf', append:true); // APPENDED
// OVERWRITTEN
$vCardCollection->export('./file/export/destination.vcf', append:false);
```
```php
// APPENDED
$vCardCollection->export('./file/export/destination.vcf', append:true);
```

## Contribute
Expand Down
24 changes: 24 additions & 0 deletions docs/export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[Documentation homepage](index.md)

# Exporting files

## vCards

The existing .vcf file will be overwritten.

```php
$vCard->export('./file/export/destination.vcf');
```

## Collections

The existing .vcf can be overwritten or appended.

```php
// OVERWRITTEN
$vCardCollection->export('./file/export/destination.vcf', append:false);
```
```php
// APPENDED
$vCardCollection->export('./file/export/destination.vcf', append:true);
```

0 comments on commit 2e270e0

Please sign in to comment.