Weave 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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib