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

@parent directive does not require arguments #31

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

ernix
Copy link
Contributor

@ernix ernix commented Mar 15, 2024

[BLADE_V013] Required arguments missing for [@parent] on line 4

@parent directive is just a placeholder that does not have any arguments. I feel the need for tests against official documentation, but the official documentation is more focused on use cases rather than specifications, so there's currently no clear guidance on how to construct tests.

See also:

<!-- resources/views/child.blade.php -->

@extends('layouts.app')

@section('title', 'Page Title')

@section('sidebar')
    @parent

    <p>This is appended to the master sidebar.</p>
@endsection

@section('content')
    <p>This is my body content.</p>
@endsection

> [BLADE_V013] Required arguments missing for [@parent] on line 4

@parent directive is just a placeholder that does not have any
arguments.  I feel the need for tests against official documentation,
but the official documentation is more focused on use cases rather than
specifications, so there's currently no clear guidance on how to
construct tests.

See also:

* https://github.com/laravel/framework/blob/2af985e2c26496f2870535b9079dbb207b1dde9a/src/Illuminate/View/Compilers/Concerns/CompilesLayouts.php#L61-L71
* https://laravel.com/docs/10.x/blade#extending-a-layout

~~~
<!-- resources/views/child.blade.php -->

@extends('layouts.app')

@section('title', 'Page Title')

@section('sidebar')
    @parent

    <p>This is appended to the master sidebar.</p>
@endsection

@section('content')
    <p>This is my body content.</p>
@endsection
~~~
@JohnathonKoster
Copy link
Collaborator

JohnathonKoster commented Mar 15, 2024

feel the need for tests against official documentation

Thank you for the contribution; they are always appreciated.

@JohnathonKoster JohnathonKoster merged commit de29c22 into Stillat:master Mar 15, 2024
10 checks passed
@ernix ernix deleted the parent-requires-no-args branch March 15, 2024 01:49
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.

2 participants