File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Classes/ViewHelpers/Component Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -167,19 +167,21 @@ function () {
167167 /**
168168 * Renders inline fluid code in a fixture array that will be provided as example data to a component
169169 *
170- * @param array $data
170+ * @param mixed $data
171171 * @param RenderingContextInterface $renderingContext
172- * @return void
172+ * @return mixed
173173 */
174- public static function renderFluidInExampleData (array $ data , RenderingContextInterface $ renderingContext )
174+ public static function renderFluidInExampleData ($ data , RenderingContextInterface $ renderingContext )
175175 {
176- return array_map (function ($ value ) use ($ renderingContext ) {
177- if (is_string ($ value )) {
178- return $ renderingContext ->getTemplateParser ()->parse ($ value )->render ($ renderingContext );
179- } else {
180- return $ value ;
181- }
182- }, $ data );
176+ if (is_string ($ data )) {
177+ return $ renderingContext ->getTemplateParser ()->parse ($ data )->render ($ renderingContext );
178+ } elseif (is_array ($ data )) {
179+ return array_map (function ($ value ) use ($ renderingContext ) {
180+ return self ::renderFluidInExampleData ($ value , $ renderingContext );
181+ }, $ data );
182+ } else {
183+ return $ data ;
184+ }
183185 }
184186
185187 /**
You can’t perform that action at this time.
0 commit comments