-
Couldn't load subscription status.
- Fork 265
Add optional id argument to the blade directive #178
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
Conversation
|
@daniel-werner Did you test this manually as well? Apparently we had this feature before (#139), which caused #140. Admittedly, that one didn't have any tests, but the implementation itself looks very similar? |
|
@claudiodekker Yes, I just tested this manually and it works. However during the implementation and testing I also encountered the same issue from #140. So, when the directive is called without arguments, an empty string is passed to the function, because of the This is why the default argument value ($id = 'app') is not working because it is actually always called with an argument. So checking for an empty value and defaulting to 'app' works. Hope my explanation makes sense. |
|
Managed to test this, and it indeed works mostly as you described:
|
|
Is there anyway we can remove the quotes when doing this? @inertia('test') |
|
I think, we could trim the single and double quotes in the directive function |
|
@daniel-werner Are you able to try and make that happen? |
|
@reinink Fixed it |
|
Thanks! Let me do some testing with this. 👍 |
|
I'll be closing this PR, as we've actually already re-implemented this as part of #339 👍 |
Hi,
I had a situation where a div with id="app" already existed where I wanted to use the @inertia directive.
I solved it by changing the other div, but I thought it would be good to be able to pass the id as an optional argument to the directive like @interia('div-id')
This PR implements the above mentioned feature, and adds a test to it.
Please let me know what do you think.