Skip to content

Commit

Permalink
update recipe to use request_stack
Browse files Browse the repository at this point in the history
current version uses `request` service which is deprecated since sf3 and best practice since 2.4
  • Loading branch information
davidgorges authored Dec 30, 2016
1 parent 1be584c commit d65ee17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Resources/doc/cookbook/recipe_image_previews.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ we are manipulating form fields we do this from within ``ImageAdmin::configureFo
if ($image && ($webPath = $image->getWebPath())) {
// get the container so the full path to the image can be set
$container = $this->getConfigurationPool()->getContainer();
$fullPath = $container->get('request')->getBasePath().'/'.$webPath;
$fullPath = $container->get('request_stack')->getCurrentRequest()->getBasePath().'/'.$webPath;
// add a 'help' option containing the preview's img tag
$fileFieldOptions['help'] = '<img src="'.$fullPath.'" class="admin-preview" />';
Expand Down

0 comments on commit d65ee17

Please sign in to comment.