PHP code example of damianociarla / tag-bundle

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

    

damianociarla / tag-bundle example snippets


	// app/AppKernel.php

	public function registerBundles()
	{
	    $bundles = array(
        	// ...
        	new DCS\TagBundle\DCSTagBundle(),
    	);
	}

## 2) Create your Tag classes

In this first release DCSTagBundle supports only Doctrine ORM. However, you must provide a concrete Tag class.
You must extend the abstract entity provided by the bundle and creating the appropriate mapping.

### a) Annotation

    
    // src/Acme/TagBundle/Entity/Tag.php

    namespace Acme\TagBundle\Entity;

    use DCS\TagBundle\Entity\Tag as BaseTag;
    use Doctrine\ORM\Mapping as ORM;

    /**
     * @ORM\Entity
     * @ORM\Table(name="tag")
     */
    class Tag extends BaseTag
    {

    }

### b) xml

    
    // src/Acme/TagBundle/Entity/Tag.php

    namespace Acme\TagBundle\Entity;

    use DCS\TagBundle\Entity\Tag as BaseTag;

    class Tag extends BaseTag
    {

    }

XML mapping file

    <!-- src/Acme/TagBundle/Resources/config/doctrine/Tag.orm.xml -->

    <?xml version="1.0" encoding="UTF-8"