Download the PHP package fpn/tag-bundle without Composer

On this page you can find all versions of the php package fpn/tag-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tag-bundle

FPNTagBundle

This bundle adds tagging to your Symfony project, with the ability to associate tags with any number of different entities. This bundle integrates the DoctrineExtensions-Taggable library, which handles most of the hard work.

Navigation

  1. Installation
  2. Making an entity taggable
  3. Using Tags

Installation

Use Composer

You can use composer to add the bundle :

Or you can edit your composer.json, and add :

"require": {
    "fpn/tag-bundle":"dev-master",
}

Register the bundle

To start using the bundle, register it in your Kernel. This file is usually located at app/AppKernel:

public function registerBundles()
{
    $bundles = array(
        // ...
        new FPN\TagBundle\FPNTagBundle(),
    );
)

Create your Tag and Tagging entities

To use this bundle, you'll need to create two new entities: Tag and Tagging. You place these in any bundle, but each should look like this:

Next, you'll need to add a little bit of mapping information. One way to do this is to create the following two XML files and place them in the Resources/config/doctrine directory of your bundle:

src/Acme/TagBundle/Resources/config/doctrine/Tag.orm.xml:

src/Acme/TagBundle/Resources/config/doctrine/Tagging.orm.xml:

You can also use Annotations :

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

src/Acme/TagBundle/Entity/Tagging.php:

Define classes on configuration

On your configuration you have to define tag and tagging classes.

Example on yaml:

Making an Entity Taggable

Suppose we have a Post entity, and we want to make it "taggable". The setup is simple: just add the Taggable interface and add the necessary 3 methods:

That's it! As you'll see in the next section, the tag manager can now manage the tags that are associated with your entity.

Using Tags

The bundle works by using a "tag manager", which is responsible for creating tags and adding them to your entities. For some really good usage instructions, see Using TagManager.

Basically, the idea is this. Instead of setting tags directly on your entity (e.g. Post), you'll use the tag manager to set the tags for you. Let's see how this looks from inside a controller. The tag manager is available as the fpn_tag.tag_manager service:

use Acme\BlogBundle\Entity\Post;

public function createTagsAction()
{
    // create your entity
    $post = new Post();
    $post->setTitle('foo');

    $tagManager = $this->get('fpn_tag.tag_manager');

    // ask the tag manager to create a Tag object
    $fooTag = $tagManager->loadOrCreateTag('foo');

    // assign the foo tag to the post
    $tagManager->addTag($fooTag, $post);

    $em = $this->getDoctrine()->getEntityManager();

    // persist and flush the new post
    $em->persist($post);
    $em->flush();

    // after flushing the post, tell the tag manager to actually save the tags
    $tagManager->saveTagging($post);

    // ...

    // Load tagging ...
    $tagManager->loadTagging($post);
}

All versions of tag-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/framework-bundle Version >=2.0
fpn/doctrine-extensions-taggable Version v0.9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fpn/tag-bundle contains the following files

Loading the files please wait ....