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

Crud Bundle Laravel Package

araise/crud-bundle

View on GitHub
Deep Wiki
Context7

Templating

Layout Based Rendering

araise_crud:
  templateDirectory: '[@araiseCrud](https://github.com/araiseCrud)/Templates'

The template path can also be changed individually for each definition class.

class PostDefinition extends AbstractDefinition
{
    // ...
    public function getTemplateDirectory(): string
    {
        return 'myTemplates';
    }
    // ...
}

Layout Files

The layout file defines how the crud will be rendered. The default layout file is [@araiseCrud](https://github.com/araiseCrud)/layout/adminlte_layout.html.twig and can be changed in the config config/packages/araise_crud.yaml

araise_crud:
  layout: 'crud/layout/my_layout.html.twig'

Like in Symfony Forms, the layout file can be extended or overwritten. New blocks can be added or overwritten.

{% extends '[@araiseCrud](https://github.com/araiseCrud)/layout/adminlte_layout.html.twig' %}

{% block crud_show %}
    my fancy show block
    {{ parent() }}
{% endblock %}

Twig-Functions and Blocks

Main Twig-Functions

Twig-Function Default Blockname with Blockprefix -----
crud_show show N/A render_mode = 'edit'
crud_create create N/A render_mode = 'create'
crud_edit edit N/A render_mode = 'create'
crud_table table <block_prefix>_table render_mode = 'create'

crud_content_row - Twig-Function

The row block name will be dynamically created. <block_prefix> and <render_mode> will be used to create the block name.

<block_prefix>

The block_prefix can be set with the content options.

class PostDefinition extends AbstractDefinition
{
    // ...

    public function configureView(DefinitionBuilder $builder, $data)
    {
        $builder
            ->getBlock('post')
            ->addContent(
                'content',
                null,
                [
                    'label' => 'post.content',
                    'block_prefix' => 'postcontent'
                ]
            )
        ;
    }

    // ...
}

By default the block_prefix is the snake case of the class name.

Class Default Block - Prefix
\araise\CrudBundle\Content\Content content
\araise\CrudBundle\Content\RelationContent relation_content
\araise\CrudBundle\Content\TwigContent twig_content
\araise\CrudBundle\Content\Content content

Table Rendering

Twig-Function Default Blockname with Blockprefix ---
crud_table table <block_prefix>_table eg. post_table
crud_table_header_cell table_header <block_prefix>_header eg. posttitle_header
crud_table_content_cell table_cell <block_prefix>_cell eg. posttitle_cell
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.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware