diff --git a/Annotation/Sandbox.php b/Annotation/Sandbox.php index 0c25480..7813977 100644 --- a/Annotation/Sandbox.php +++ b/Annotation/Sandbox.php @@ -8,4 +8,10 @@ */ class Sandbox { + /** + * Type of returned value of target to which annotation applied + * + * List of allowed types is defined in `intaro.twig_sandbox.sandbox_annotation.value_types` parameter + */ + public $type = 'string'; } \ No newline at end of file diff --git a/README.md b/README.md index e0b8741..d4473e5 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,12 @@ $ composer update intaro/twig-sandbox-bundle ## Usage -Define allowed properties and methods for your entities throw annotation `@Sandbox`. +Define allowed properties and methods for your entities using annotation `@Sandbox`. +Optionally you can add `type` option for annotation. +This option defines type of value that property stores or method returns. + +In your application you can use annotation reader to extract value of `type` option and use this value +to perform additional checks or any other actions, for example, use twig filters according to value of the option. ```php