Commits

Arkadiusz Dzięgiel  committed d5c7fee

Added widget usage in readme
behavior: respect propel connection

  • Participants
  • Parent commits 965f483

Comments (0)

Files changed (2)

File Lib/Behavior/TaggableBehavior.php

     		
     		\$tags = TagQuery::create()
     		->filterByName(\$tagNames)
-    		->find();
+    		->find(\$con);
     		
     		\$existingTags = array();
     		foreach(\$tags as \$t) \$existingTags[] = \$t->getName();
     $tag = TagQuery::create()->findOneByName('symfony');
     $articles = ArticleQuery::create()->filterByTag($tag)->find();
     
+
+As widget in forms
+
+::
+
+	<?php
+	namespace SofthisCMS\CmsGalleryBundle\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' => 'Propel\Model\CmsGalleryBundle\Model\Gallery',
+			);
+		}
+	
+		public function buildForm(FormBuilder $builder, array $options)
+		{
+			$builder->add('title', 'text', array('label'=>'Tytuł'));
+			$builder->add('tags', 'tags', array('label' => 'Tagi', 'defaultText'=>'add tag'));
+		}
+	
+		public function getName(){
+			return 'gallery';
+		}
+	
+	}