Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Rock Bundle Laravel Package

braunstetter/rock-bundle

View on GitHub
Deep Wiki
Context7

Template Hooks

Rock templates give you an opportunity to hook into them using the hook tag.

Rock templates provide usually hooks. For example:

{% hook 'my-custom-hook-name' %}

To "hook into this" just create a class and extend Rock\Twig\TemplateHook:

namespace App\Twig;

use Rock\Twig\TemplateHook;

class MyHook extends TemplateHook
{

    public function render(): string
    {
        return $this->templating->render('my-template.html.twig');
    }

    public function setTarget(): string
    {
        return 'my-custom-hook-name';
    }

}

And yes - you are done so!

Two methods are neccessary. render and setTarget. Render is for rendering the template you want to inject. And the setTargetmethod tells Rock which hook you want to use.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui