2017 © Pedro Peláez
 

symfony-bundle taggable-bundle

Taggable bundle for symfony based on taggable behavior

image

smirik/taggable-bundle

Taggable bundle for symfony based on taggable behavior

  • Monday, June 17, 2013
  • by smirik
  • Repository
  • 1 Watchers
  • 0 Stars
  • 547 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

TaggableBundle

A behavior and a widget for symfony 2.1 and propel 1.6, (*1)

How to install

  • Add to composer.json
{
    "require": {
      "smirik/propel-taggable-behavior": "*",
      "smirik/taggable-bundle": "*"
    }
}
  • enable the plugin in your AppKernel class

app/AppKernel.php, (*2)

class AppKernel extends AppKernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Smirik\TaggableBundle\SmirikTaggableBundle(),
            ...
        );
    }
}
  • add the taggable behavior to propel.ini or config.yml (build properties)

config/schema.xml, (*3)

<table name="articles" phpName="Article">
    <behavior name="taggable" />
    <column name="id" type="integer" primaryKey="true" autoIncrement="true"/>
    <column name="title" type="varchar" size="255" />
    <!-- ... -->
</table>
  • rebuild your model
php app/console propel:build
  • As widget in forms
namespace Acme\GalleryBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class GalleryType extends AbstractType
{
    public function getDefaultOptions(array $options)
    {
        return array(
            'data_class' => 'Glorpen\GalleryBundle\Model\Gallery',
        );
    }

    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder->add('title', 'text', array('label'=>'Title'));
        $builder->add('tags', 'tags', array('label' => 'Tags', 'defaultText'=>'add tag', 'class' => 'YOUR_TAG_CLASS_WITH_NAMESPACE'));
    }

    public function getName(){
        return 'gallery';
    }

}

The Versions

17/06 2013

dev-master

9999999-dev http://4xxi.com

Taggable bundle for symfony based on taggable behavior

  Sources   Download

The Requires

 

by Matteo Giachino (matteosister)
by Virginie BARDALES (vbardales)

behavior taggable propel

13/08 2012

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/vbardales/PropelTaggableBehaviorBundle

A behavior and a widget for symfony 2.x and propel 1.6

  Sources   Download

The Requires

 

by Matteo Giachino (matteosister)
by Virginie BARDALES (vbardales)

behavior taggable propel