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

@component directive formatting is inconsistent #771

Closed
hjanos1 opened this issue Jan 9, 2023 · 1 comment · Fixed by #772
Closed

@component directive formatting is inconsistent #771

hjanos1 opened this issue Jan 9, 2023 · 1 comment · Fixed by #772
Assignees

Comments

@hjanos1
Copy link
Contributor

hjanos1 commented Jan 9, 2023

Formatting an @component directive with passed in data is inconsistent with doing the same with an @include directive, as seen below.

Code example derived from tests:

@component('path.to.component', [
    'title' => 'My title',
    'description' => '',
    'header' => [
        'transparent' => true,
    ],
    'footer' => [
        'hide' => true,
    ],
])
    <div>
        some content
    </div>
@endcomponent

@include('path.to.component', [
    'title' => 'My title',
    'description' => '',
    'header' => [
        'transparent' => true,
    ],
    'footer' => [
        'hide' => true,
    ],
])

Current Behavior

@component('path.to.component',
    [
        'title' => 'My title',
        'description' => '',
        'header' => [
            'transparent' => true,
        ],
        'footer' => [
            'hide' => true,
        ],
    ])
    <div>
        some content
    </div>
@endcomponent

@include('path.to.component', [
    'title' => 'My title',
    'description' => '',
    'header' => [
        'transparent' => true,
    ],
    'footer' => [
        'hide' => true,
    ],
])

Expected Behavior

@component('path.to.component', [
    'title' => 'My title',
    'description' => '',
    'header' => [
        'transparent' => true,
    ],
    'footer' => [
        'hide' => true,
    ],
])
    <div>
        some content
    </div>
@endcomponent

@include('path.to.component', [
    'title' => 'My title',
    'description' => '',
    'header' => [
        'transparent' => true,
    ],
    'footer' => [
        'hide' => true,
    ],
])

Possible Solution

I am sending a PR to fix the issue.

@shufo
Copy link
Owner

shufo commented Jan 14, 2023

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 a pull request may close this issue.

2 participants