8000 Documented minor BC break introduced in AssetHelper by peterrehm · Pull Request #14940 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Documented minor BC break introduced in AssetHelper #14940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions UPGRADE-2.7.md
< 8000 td id="diff-9b92959dcfec64683ae836ab03e68db0f92e247eb9d7d7ebbb6079c6e15146a7R625" data-line-number="625" class="blob-num blob-num-addition js-linkable-line-number js-blob-rnum">
Original file line number Diff line number Diff line change
Expand Up @@ -592,3 +592,54 @@ TwigBundle
background: {{ brand_color|raw }};
}
```

FrameworkBundle
---------------

* The `templating.helper.assets` was refactored and returns now an object of the type
`Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper` instead of
`Symfony\Component\Templating\Helper\CoreAssetsHelper`. You can update your class definition
or use the `assets.package` service instead. Using the `assets.package` service is the recommended
way. The `templating.helper.assets` service will be removed in Symfony 3.0.

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();
}
}
```
2 changes: 1 addition & 1 deletion UPGRADE-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ 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 moved to `templating_php.xml`. You can
* The `templating.helper.assets` was removed in Symfony 3.0. You should
use the `assets.package` service instead.

Before:
Expand Down
0