Skip to content

Commit

Permalink
Update documentation : display bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Claverie committed Jan 28, 2019
1 parent eecfe1f commit 9b02489
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 35 deletions.
28 changes: 14 additions & 14 deletions Resources/doc/export/create_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ When some exports are defined, a selector is displayed with an export button.

We'll try to create a CSV export.

1. **Create a class wherever you want and extend it with the Export class of the bundle.**
### 1. Create a class wherever you want and extend it with the Export class of the bundle.

```php
<?php
Expand All @@ -34,12 +34,12 @@ class CSVExport extends Export

| parameter | Type | Default value | Description |
| --------- | ------ | ------------- | ---------------------------------------------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |

2. **Add this export to the grid in your controller**
### 2. Add this export to the grid in your controller

```php
<?php
Expand All @@ -66,15 +66,15 @@ class DefaultController extends Controller

And the template:

```janjo
```twig
<!-- AppBundle::grid.html.twig -->
{{ grid(grid) }}
```

That's all ! You can test your export. Go to your controller page and select `CSV Export` in the export selector and click the export button. A download window appears and... yes ! You have a file with the name `export` with no extension and no content.

3. **Define the extension and the mime type of your export.**
### 3. Define the extension and the mime type of your export.

```php
<?php
Expand All @@ -95,9 +95,9 @@ class CSVExport extends Export
}
```

4. **Define the content of the export.**
### 4. Define the content of the export.

The computeData method is the front door of an export. The grid calls this method with itself as argument.
The `computeData` method is the front door of an export. The grid calls this method with itself as argument.
The purpose of this method is to fill the content of the export.

Try this exemple:
Expand All @@ -120,9 +120,9 @@ class CSVExport extends Export
}
```

Now you have a export with a filename `export.csv` and the content `Hello world!`
Now you have an export with a filename `export.csv` and the content `Hello world!`

5. **Get the grid data to fill the content of the export**
### 5. Get the grid data to fill the content of the export

The export class have some helper functions to get the data of the grid.

Expand Down Expand Up @@ -180,9 +180,9 @@ array(
)
```

Available methods: Export::getGridTitles, Export::getRawGridTitles, Export::getGridRows and Export::getRawGridRows
Available methods: `Export::getGridTitles`, ̀ Export::getRawGridTitles`, `Export::getGridRows` and `Export::getRawGridRows`.

6. **Fill the content of the export**
### 6. Fill the content of the export

```php
<?php
Expand Down Expand Up @@ -221,9 +221,9 @@ class CSVExport extends Export
}
```

Voil�, you can export your grid in a csv file.
Voilà, you can export your grid in a csv file.

7. **Additional parameters**
### 7. Additional parameters

In French - for instance - Microsoft Excel accepts only CSV with the delimiter semi-colon `;`. You can add an additional parameter to resolve this difference.

Expand Down Expand Up @@ -282,7 +282,7 @@ $grid->addExport(new CSVExport('CSV Export in French', 'export', array('delimite
...
```

8. **Define the charset of the export file**
### 8. Define the charset of the export file

In French - for instance again - Microsoft Excel doesn't displayed correctly special characters. To resolve this problem, you have to define the charset of your export file.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $grid->addExport(new PHPExcelHTMLExport($title, $fileName, $params, $charset, $r

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $grid->addExport(new PHPExcelPDFExport($title, $fileName, $params, $charset, $ro

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $grid->addExport(new PHPExcel2003Export($title, $fileName, $params, $charset, $r

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $grid->addExport(new PHPExcel2007Export($title, $fileName, $params, $charset, $r

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $grid->addExport(new PHPExcel5Export($title, $fileName, $params, $charset, $role

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
20 changes: 10 additions & 10 deletions Resources/doc/export/native_exports/CSV_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ $grid->addExport(new CSVExport($title, $fileName, $params, $charset, $role));

#### CSVExport::__construct parameters

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
| role | mixed | null | Don't add this export if the access isn't granted for the defined role(s) |
| parameter | Type | Default value | Description |
| --------- | ------ | ------------- | ------------------------------------------------------------------------- |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
| role | mixed | null | Don't add this export if the access isn't granted for the defined role(s) |

## Additional parameters for the export

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| delimiter | string | , | The delimiter of csv columns. |
| parameter | Type | Default value | Description |
| --------- | ------ | ------------- | ----------------------------- |
| delimiter | string | , | The delimiter of csv columns. |

## Example
```php
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/export/native_exports/DSV_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $grid->addExport(new DSVExport($title, $fileName, $params, $charset, $role));

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters (Delimiter and BOM). |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/export/native_exports/Excel_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $grid->addExport(new ExcelExport($title, $fileName, $params, $charset, $role));

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/export/native_exports/JSON_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $grid->addExport(new JSONExport($title, $fileName, $params, $charset, $role));

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/export/native_exports/SCSV_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $grid->addExport(new SCSVExport($title, $fileName, $params, $charset, $role));

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/export/native_exports/TSV_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $grid->addExport(new TSVExport($title, $fileName, $params, $charset, $role));

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/export/native_exports/XML_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $grid->addExport(new XMLExport($title, $fileName, $params, $charset, $role));

| parameter | Type | Default value | Description |
| --------- | ---- | ------------- | ----------- |
| title | string | - | Title of the export in the selector. |
| title | string | | Title of the export in the selector. |
| fileName | string | export | Name of the export file without the extension. |
| params | array | array() | Additionnal parameters. |
| charset | string | UTF-8 | Charset to convert the ouput of the export. |
Expand Down

0 comments on commit 9b02489

Please sign in to comment.