PHP code example of opifer / form-bundle

1. Go to this page and download the library: Download opifer/form-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/ */

    

opifer / form-bundle example snippets


public function registerBundles()
{
    $bundles = array(
        // ...
        new Opifer\EavBundle\OpiferEavBundle(),
        new Opifer\FormBundle\OpiferFormBundle()
    );
}


namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Opifer\FormBundle\Model\Form as BaseForm;

/**
 * @ORM\Entity()
 * @ORM\Table(name="form")
 */
class Form extends BaseForm
{

}


namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Opifer\EavBundle\Model\EntityInterface;
use Opifer\FormBundle\Model\Post as BasePost;

/**
 * @ORM\Entity()
 * @ORM\Table(name="post")
 */
class Post extends BasePost implements EntityInterface
{

}


namespace AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class PageController extends Controller
{
    public function contactAction()
    {
        $form = $this->get('opifer.form.form_manager')->getRepository()->find(1);
        
        return $this->render('Page/contact.html.twig', array(
            'form' => $form
        ));
    }
}