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

Alias for each assets package#30645

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@gpenverne
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks??
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

Add autowiring by type + name on assets packages

framework:assets:packages:xxx:base_urls:'xxxx'
<?phpclass MyService {private$xxxPackage;publicfunction__construct(PackageInterface$xxxPackage)     {$this->xxxPackage =$xxxPackage;...    }publicfunctionmyMethod():string    {return$this->xxxPackage->getUrl('some-image.png');    }}

instead of:

<?phpclass MyService {private$packages;publicfunction__construct(Packages$packages)     {$this->packages =$packages;...    }publicfunctionmyMethod():string    {return$this->packages->getPackage('xxx')->getUrl('some-image.png');    }}

deguif, AlexALTP, ACHP, kbsali, bgaillard, and ndavoust reacted with thumbs up emoji
@deguif
Copy link
Contributor

deguif commentedMar 22, 2019
edited
Loading

Nice, I already needed this in the past.
The main advantage for me would be that it triggers error during container compilation when package doesn't exist (instead of detecting it at runtime).

@gpenvernegpenverneforce-pushed theimprovement-alias-for-each-assets-package branch from1d8767e tod89e46aCompareMarch 22, 2019 14:15
@gpenvernegpenverneforce-pushed theimprovement-alias-for-each-assets-package branch fromd89e46a toe8b9856CompareMarch 22, 2019 14:17
@nicolas-grekasnicolas-grekas added this to thenext milestoneMar 25, 2019
@fabpot
Copy link
Member

@gpenverne Can you submit a PR on the docs?

@fabpot
Copy link
Member

Thank you@gpenverne.

@fabpotfabpot merged commite8b9856 intosymfony:masterMar 27, 2019
fabpot added a commit that referenced this pull requestMar 27, 2019
This PR was merged into the 4.3-dev branch.Discussion----------Alias for each assets package| Q             | A| ------------- | ---| Branch?       | master <!-- see below -->| Bug fix?      | no| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | ?     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets |   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | <!-- required for new features -->Add autowiring by type + name on assets packages```yamlframework:    assets:        packages:            xxx:                base_urls: 'xxxx'``````php<?phpclass MyService{    private $xxxPackage;    public function __construct(PackageInterface $xxxPackage)    {        $this->xxxPackage = $xxxPackage;        ...    }    public function myMethod(): string    {        return $this->xxxPackage->getUrl('some-image.png');    }}```instead of:```php<?phpclass MyService{    private $packages;    public function __construct(Packages $packages)    {        $this->packages = $packages;        ...    }    public function myMethod(): string    {        return $this->packages->getPackage('xxx')->getUrl('some-image.png');    }}```Commits-------e8b9856 Alias for each assets package
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

5 participants

@gpenverne@deguif@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp