Stopping Injecting Content Into a Section


You're finished with a Blade section, but don't want to output it yet.


Use the Blade @stop command to end the section.

    <li><a href="#">link 1</a></li>
    <li><a href="#">link 2</a></li>

Now your template will have a section named nav which you can output later with a @yield command.


Note that this doesn't append to existing sections.

If you want to append to an existing section, end the section with @append.

The @stop command does not overwrite existing sections.

Imagine you had the following Blade template.


What would be output is.


You can use the comment to pull in the contents of the previous section. See the Pulling in the Content of a Parent Section in Blade recipe.

comments powered by Disqus