11# fundraising-content-provider
22
3- [ ![ Build Status] ( https://travis-ci.org/wmde/fundraising-content-provider.svg?branch=master )] ( https://travis-ci.org/wmde/fundraising-content-provider )
4-
53A wrapper around [ htmlpurifier] ( http://htmlpurifier.org ) and [ twig] ( https://github.com/twigphp/Twig )
64to purify [ fundraising-frontend-content] ( https://github.com/wmde/fundraising-frontend-content ) content
75before rendering it into [ FundraisingFrontend] ( https://github.com/wmde/FundraisingFrontend/ ) .
86
97# Using fundraising-frontend-content inside FundraisingFrontend
108
11- $contentProvider = new ContentProvider( ['content_path' => '/my/fundraising-frontend-content'] );
12- // contents of fundraising-frontend-content/web & fundraising-frontend-content/shared
9+ $contentProvider = TwigContentProviderFactory::createContentProvider(
10+ new TwigContentProviderConfig( '/my/fundraising-frontend-content/i18n/LOCALE/' )
11+ );
12+
13+ // get contents of fundraising-frontend-content/web & fundraising-frontend-content/shared
1314 $contentProvider->getWeb('template_name');
14- // contents of fundraising-frontend-content/mail & fundraising-frontend-content/shared
15+
16+ // get contents of fundraising-frontend-content/mail & fundraising-frontend-content/shared
1517 $contentProvider->getMail('template_name');
1618
1719# Running lints
@@ -26,23 +28,10 @@ before rendering it into [FundraisingFrontend](https://github.com/wmde/Fundraisi
2628
2729# Development
2830
29- ## Run phpunit tests
31+ ## Run PHPUnit tests
3032
3133 docker run -it --rm --user $(id -u):$(id -g) -v "$PWD":/app -w /app
3234 php:8.0-alpine ./vendor/bin/phpunit
3335
3436(you have to have docker installed for this to work)
3537
36- # Release notes
37-
38- ## Version 2.0 (2017-04-28)
39-
40- * Content is no longer purified when loading it (purifying broke twig templates)
41- * renamed linter & added twig syntax checks
42- * Also allowing the following HTML tags: ` hr ` , ` u `
43- * Also allowing ` target="_blank" ` attribute links (` a ` )
44-
45- ## Version 1.0 (2017-04-26)
46-
47- * Initial Release
48- * Providing a service that loads and purifies (some paths) templates, returns content
0 commit comments