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

Fast Show Generator Bundle Laravel Package

acseo/fast-show-generator-bundle

Symfony bundle to quickly generate “show” view data for entities using annotations or YAML. Define labels, visibility, and groups per property, then fetch showable data in your controller and render it easily in Twig. Compatible with Symfony 5/6.

View on GitHub
Deep Wiki
Context7

ACSEOFastShowGeneratorBundle

ACSEOFastShowGeneratorBundle allows to quickly generate show actions based on annotation or yaml This bundle was initiated by Nicolas Kern (ACSEO).

Version: 2.0 Compatibility: Symfony ^5.0 || ^6.0

Installation using Composer

$ composer install acseo/fast-show-generator-bundle

Composer will install the bundle to your project's vendor/ACSEO directory.

How To Use

Annotation

In entity :

use ACSEO\FastShowGeneratorBundle\Annotations as ACSEOFastShowGeneratorBundle;

For each property :

* @ACSEOFastShowGenerator\Show(label="My Property 1", show=true, groups={"default"})

In controller :

$fastShow = $this->get('acseo_fast_show_generator.driver.annotation');

$fastShow->setEntity(new MyEntity());
$fastShow->setGroup('default');
$fastShow->setClassMetadata($em->getClassMetadata("ACSEOMyBundle:MyEntity"));

$fastShowData = $fastShow->getShowableData();

YAML :

Create the a file in your bundle for each entity :

#ACSEO/Bundle/MyBundle/Resources/config/fastshowgenerator/MyEntity.default.fastshowgenerator.yml

ACSEO\Bundle\MyBundle\Entity\MyEntity:
    Columns:
        myProperty:
            label: My Property 1
            show: true
            groups: {"default"}
        myProperty2:
            label: My Property 2
            show: true
            groups: {"default"}

In controller :

        $fastShow = $this->get('acseo_fast_show_generator.driver.yaml');

        $fastShow->setEntity($entity);
        $fastShow->setGroup('default');
        $fastShow->setClassMetadata($em->getClassMetadata($this->getEntityName()));

        $fastShowData = $fastShow->getShowableData();

Available options :

label : string - optional - if not set, uses the property name capitalized
show : boolean - optional - if not set, value is assumed to be true
groups : array - optional - if not set, group name is "default"

Template

Now, in your twig file, something like that :

    <table class="table table-striped">
      <tbody>
        {% for propertyName, propertyValue in data %}
            <tr><td>{{ propertyName }}</td><td>{{ propertyValue }}</td></tr>
        {% endfor %}
      </tbody>
    </table>
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.
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
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager