Skip to content

A class that removes unwanted HTML from content for the WMDE fundraising frontend

License

Notifications You must be signed in to change notification settings

wmde/fundraising-content-provider

Repository files navigation

fundraising-content-provider

A wrapper around htmlpurifier and twig to purify fundraising-frontend-content content before rendering it into FundraisingFrontend.

Using fundraising-frontend-content inside FundraisingFrontend

$contentProvider = TwigContentProviderFactory::createContentProvider(
	new TwigContentProviderConfig( '/my/fundraising-frontend-content/i18n/LOCALE/' )
);

// get contents of fundraising-frontend-content/web & fundraising-frontend-content/shared
$contentProvider->getWeb('template_name');

// get contents of fundraising-frontend-content/mail & fundraising-frontend-content/shared
$contentProvider->getMail('template_name');

Running lints

# When installed as a dependency and PHP is available:
vendor/bin/lint_content /contentpath/de_DE --web pages/imprint

# running in a docker container
docker run -it --rm -v \
~/projects/fundraising-frontend-content/i18n:/contentpath -v \
"$PWD":/usr/src/myapp -w /usr/src/myapp php:8.0-alpine ./bin/lint_content /contentpath/de_DE --web pages/imprint

Development

Run PHPUnit tests

docker run -it --rm --user $(id -u):$(id -g) -v "$PWD":/app -w /app \
php:8.2-alpine ./vendor/bin/phpunit

(you have to have docker installed for this to work)

About

A class that removes unwanted HTML from content for the WMDE fundraising frontend

Resources

License

Stars

Watchers

Forks

Packages

No packages published