Custom Placeholder
Each placeholder is defined with a class responsible for replacing a specific string tag with a dynamic value. Placeholder class needs to extend EasyWatermark\Placeholders\Abstracts\Placeholder
and should implement the following methods:
resolve
- returning the value of the placeholdervalidate
- checking if the value is correctsanitize
- sanitizing the value
There are also 4 abstract placeholders available that implement the validate
and sanitize
methods for a given value type:
EasyWatermark\Placeholders\Abstracts\EmailPlaceholder
EasyWatermark\Placeholders\Abstracts\IntegerPlaceholder
EasyWatermark\Placeholders\Abstracts\StringPlaceholder
EasyWatermark\Placeholders\Abstracts\UrlPlaceholder
Placeholder class
The above class will replace a %favorite_color%
string in the watermark text with the value of a favorite_color
meta for logged-in user.
Registering the Placeholder
Last updated