PHP code example of shapecode / hidden-entity-type-bundle

1. Go to this page and download the library: Download shapecode/hidden-entity-type-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shapecode / hidden-entity-type-bundle example snippets



// config/bundles.php

return [
    // ...
    Shapecode\Bundle\HiddenEntityTypeBundle\ShapecodeHiddenEntityTypeBundle::class => ['all' => true],
    // ...
];



use Shapecode\Bundle\HiddenEntityTypeBundle\Form\Type\HiddenEntityType;

// ...
$builder->add('entity', HiddenEntityType::class, array(
    'class' => YourBundleEntity::class
));



use Shapecode\Bundle\HiddenEntityTypeBundle\Form\Type\HiddenDocumentType;

// ...
$builder->add('document', HiddenDocumentType::class, array(
    'class' => YourBundleDocument::class
));


// ...
$builder->add('entity', HiddenEntityType::class, array(
    'class' => YourBundleEntity::class, //  // support for an array of entities, not o entity found, not