Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72782bb

Browse files
committed
minor#14940 Documented minor BC break introduced in AssetHelper (peterrehm)
This PR was squashed before being merged into the 2.7 branch (closes#14940).Discussion----------Documented minor BC break introduced in AssetHelper| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#14898| License | MIT| Doc PR | -This should be an easy fix. As this AssetHelper is removed in 3.0 I think no correction for 3.0 would be needed.Commits-------777dc45 Documented minor BC break introduced in AssetHelper
2 parents83bdaa5 +777dc45 commit72782bb

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

‎UPGRADE-2.7.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,3 +592,54 @@ TwigBundle
592592
background: {{ brand_color|raw }};
593593
}
594594
```
595+
596+
FrameworkBundle
597+
---------------
598+
599+
* The`templating.helper.assets` was refactored and returns now an object of the type
600+
`Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper` instead of
601+
`Symfony\Component\Templating\Helper\CoreAssetsHelper`. You can update your class definition
602+
or use the`assets.package` service instead. Using the`assets.package` service is the recommended
603+
way. The`templating.helper.assets` service will be removed in Symfony 3.0.
604+
605+
Before:
606+
607+
```php
608+
use Symfony\Component\Templating\Helper\CoreAssetsHelper;
609+
610+
class DemoService
611+
{
612+
private $assetsHelper;
613+
614+
public function __construct(CoreAssetsHelper $assetsHelper)
615+
{
616+
$this->assetsHelper = $assetsHelper;
617+
}
618+
619+
public function testMethod()
620+
{
621+
return $this->assetsHelper->getUrl('thumbnail.png', null, $this->assetsHelper->getVersion());
622+
}
623+
}
624+
```
625+
626+
After:
627+
628+
```php
629+
use Symfony\Component\Asset\Packages;
630+
631+
class DemoService
632+
{
633+
private $assetPackages;
634+
635+
public function __construct(Packages $assetPackages)
636+
{
637+
$this->assetPackages = $assetPackages;
638+
}
639+
640+
public function testMethod()
641+
{
642+
return $this->assetPackages->getUrl('thumbnail.png').$this->assetPackages->getVersion();
643+
}
644+
}
645+
```

‎UPGRADE-3.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ UPGRADE FROM 2.x to 3.0
349349
* The`request` service was removed. You must inject the`request_stack`
350350
service instead.
351351

352-
* The`templating.helper.assets` wasmoved to`templating_php.xml`. Youcan
352+
* The`templating.helper.assets` wasremoved in Symfony 3.0. Youshould
353353
use the`assets.package` service instead.
354354

355355
Before:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp