diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-10-30 20:57:10 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@smile.fr> | 2015-11-09 16:32:48 +0100 |
commit | cceca9ea1d93ccf1420c2506330a16dc07f6433c (patch) | |
tree | e7105fc685d074ada622b55398dc9c7c2a475a2e /src/Wallabag/CoreBundle/Controller | |
parent | 268e9e7277d470dbd65b4eaa70c247ef35a95a3d (diff) | |
download | wallabag-cceca9ea1d93ccf1420c2506330a16dc07f6433c.tar.gz wallabag-cceca9ea1d93ccf1420c2506330a16dc07f6433c.tar.zst wallabag-cceca9ea1d93ccf1420c2506330a16dc07f6433c.zip |
Fix route parameters
Improve export tests
Improve CSV export
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/ExportController.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index dd3cb7ca..c8ef49a2 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php | |||
@@ -7,6 +7,10 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |||
7 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | 7 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
8 | use Wallabag\CoreBundle\Entity\Entry; | 8 | use Wallabag\CoreBundle\Entity\Entry; |
9 | 9 | ||
10 | /** | ||
11 | * The try/catch can be removed once all formats will be implemented. | ||
12 | * Still need implementation: txt. | ||
13 | */ | ||
10 | class ExportController extends Controller | 14 | class ExportController extends Controller |
11 | { | 15 | { |
12 | /** | 16 | /** |
@@ -14,7 +18,10 @@ class ExportController extends Controller | |||
14 | * | 18 | * |
15 | * @param Entry $entry | 19 | * @param Entry $entry |
16 | * | 20 | * |
17 | * @Route("/export/{id}.{format}", requirements={"id" = "\d+"}, name="export_entry") | 21 | * @Route("/export/{id}.{format}", name="export_entry", requirements={ |
22 | * "format": "epub|mobi|pdf|json|xml|txt|csv", | ||
23 | * "id": "\d+" | ||
24 | * }) | ||
18 | */ | 25 | */ |
19 | public function downloadEntryAction(Entry $entry, $format) | 26 | public function downloadEntryAction(Entry $entry, $format) |
20 | { | 27 | { |
@@ -32,7 +39,7 @@ class ExportController extends Controller | |||
32 | * Export all entries for current user. | 39 | * Export all entries for current user. |
33 | * | 40 | * |
34 | * @Route("/export/{category}.{format}", name="export_entries", requirements={ | 41 | * @Route("/export/{category}.{format}", name="export_entries", requirements={ |
35 | * "_format": "epub|mobi|pdf|json|xml|txt|csv", | 42 | * "format": "epub|mobi|pdf|json|xml|txt|csv", |
36 | * "category": "all|unread|starred|archive" | 43 | * "category": "all|unread|starred|archive" |
37 | * }) | 44 | * }) |
38 | */ | 45 | */ |