Skip to content
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

[5.6] Allow the use of component('alias') as mentioned in the documentation #23096

Closed
wants to merge 3 commits into from

Conversation

sileence
Copy link
Contributor

@sileence sileence commented Feb 9, 2018

The documentation says that after using Blade::component('components.alert', 'alert') you can call the component like: @component('alert'). That wasn't working for me, this is a possible fix.

Although I'm not happy with using the View facade in BladeCompiler (or maybe it doesn't matter?), especially because that made the tests more complicated. Other than that this might be fine.

@sisve
Copy link
Contributor

sisve commented Feb 9, 2018

Did you ever figure out why it wasn't working for you?

@taylorotwell
Copy link
Member

I am closing this pull request because it lacks sufficient explanation, tests, or both. It is difficult for us to merge pull requests without these things because the change may introduce breaking changes to the framework.

Feel free to re-submit your change with a thorough explanation of the feature and tests - integration tests are preferred over unit tests. Please include it's benefit to end users; the reasons it does not break any existing features; how it makes building web applications easier, etc.

Thanks!

@taylorotwell
Copy link
Member

@sebastiandedeyne any idea why this wouldn't be working?

@sebastiandedeyne
Copy link
Contributor

sebastiandedeyne commented Feb 9, 2018

Oh wait a minute, some confusion here. After seeing the snippet in this issue I double checked the realse notes, and apparently the example isn't what my PR was... It was never intended to alias a component path, just register a directive.

Release notes state that this is possible:

@component('alert')
    ...
@endcomponent

Only @alert was added (with the option to add extra parameters, @alert(['type' => 'success']).

See the example in the original PR: #22796

@sileence
Copy link
Contributor Author

sileence commented Feb 9, 2018

@sebastiandedeyne that's what I noticed, that the alias functionality wasn't in the code. But if it was never intended I think the documentation can be changed and that's basically it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants