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

Blade X is not properly passing the attributes #31595

Closed
ManojKiranA opened this issue Feb 26, 2020 · 2 comments
Closed

Blade X is not properly passing the attributes #31595

ManojKiranA opened this issue Feb 26, 2020 · 2 comments

Comments

@ManojKiranA
Copy link
Contributor

  • Laravel Version: 7.x-dev
  • PHP Version: 7.3.11
  • Database Driver & Version: Not Mandatory

Description:

Blade X component implemented in #31363

So based on that i have tried to pass the json which is from controller but instaed of passing a json into component its passing a compiled string

Steps To Reproduce:

Create a Component

resources\views\components\avatar.blade.php

{{$foo}}
Component Call

@php
    $array = ['foo','bar'];
    $json = json_encode($array)
@endphp

<x-avatar
foo={{$json}}
></x-avatar>

Expected: Json needs to printed out

Actual : &lt;?php echo e($json); ?&gt;

Screenshot of dumped:

image

@driesvints
Copy link
Member

Try:

<x-avatar :foo="$json"></x-avatar>

@driesvints
Copy link
Member

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

No branches or pull requests

2 participants