From 5abac565d3aa86559691b1c5eb1799e50232aca9 Mon Sep 17 00:00:00 2001 From: Paulo Rodrigues Pinto Date: Tue, 19 Jan 2016 17:38:30 +0000 Subject: [PATCH] Fix upgrade guides concerning erroneous removal of assets helper --- UPGRADE-2.7.md | 4 ++-- UPGRADE-3.0.md | 45 --------------------------------------------- 2 files changed, 2 insertions(+), 47 deletions(-) diff --git a/UPGRADE-2.7.md b/UPGRADE-2.7.md index f52220fadc..5de67ebede 100644 --- a/UPGRADE-2.7.md +++ b/UPGRADE-2.7.md @@ -596,11 +596,11 @@ TwigBundle FrameworkBundle --------------- - * The `templating.helper.assets` was refactored and returns now an object of the type + * The `templating.helper.assets` service was refactored and now returns an object of type `Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper` instead of `Symfony\Component\Templating\Helper\CoreAssetsHelper`. You can update your class definition or use the `assets.packages` service instead. Using the `assets.packages` service is the recommended - way. The `templating.helper.assets` service will be removed in Symfony 3.0. + way. Before: diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index 3e5d3817d2..e6f0e01182 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -388,51 +388,6 @@ UPGRADE FROM 2.x to 3.0 * The `request` service was removed. You must inject the `request_stack` service instead. - * The `templating.helper.assets` was removed in Symfony 3.0. You should - use the `assets.package` service instead. - - Before: - - ```php - use Symfony\Component\Templating\Helper\CoreAssetsHelper; - - class DemoService - { - private $assetsHelper; - - public function __construct(CoreAssetsHelper $assetsHelper) - { - $this->assetsHelper = $assetsHelper; - } - - public function testMethod() - { - return $this->assetsHelper->getUrl('thumbnail.png', null, $this->assetsHelper->getVersion()); - } - } - ``` - - After: - - ```php - use Symfony\Component\Asset\Packages; - - class DemoService - { - private $assetPackages; - - public function __construct(Packages $assetPackages) - { - $this->assetPackages = $assetPackages; - } - - public function testMethod() - { - return $this->assetPackages->getUrl('thumbnail.png').$this->assetPackages->getVersion(); - } - } - ``` - * The `enctype` method of the `form` helper was removed. You should use the new method `start` instead.