Skip to content

Commit

Permalink
Merge pull request raulfraile#3 from pylebecq/master
Browse files Browse the repository at this point in the history
Added sftwigextension and sfdatatransformer in readme file
  • Loading branch information
raulfraile committed Mar 23, 2012
2 parents 7f87799 + 86a72aa commit 4b6c412
Showing 1 changed file with 87 additions and 2 deletions.
89 changes: 87 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class FormNameType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{

}

public function getDefaultOptions(array $options)
Expand All @@ -107,6 +107,50 @@ class FormNameType extends AbstractType
}
```

`sfdatatransformer`

``` php
namespace VendorName\Bundle\BundleNameBundle\Form\DataTransformer;

use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Exception\TransformationFailedException;

class TransformerNameTransformer implements DataTransformerInterface
{
/**
* Transforms a value from the original representation to a transformed representation.
*
* @param mixed $value The value in the original representation
*
* @return mixed The value in the transformed representation
*
* @throws UnexpectedTypeException when the argument is not a string
* @throws TransformationFailedException when the transformation fails
*/
public function transform($value)
{

}

/**
* Transforms a value from the transformed representation to its original
* representation.
*
* @param mixed $value The value in the transformed representation
*
* @return mixed The value in the original representation
*
* @throws UnexpectedTypeException when the argument is not of the expected type
* @throws TransformationFailedException when the transformation fails
*/
public function reverseTransform($value)
{

}
}
```

### Doctrine ###

#### Annotations ####
Expand Down Expand Up @@ -154,6 +198,47 @@ class FormNameType extends AbstractType
*/
```

### Twig ###

`sftwigextension`

``` php
namespace VendorName\Bundle\BundleNameBundle\Twig\Extension;

class ExtensionNameExtension extends \Twig_Extension
{
/**
* Returns a list of filters to add to the existing list.
*
* @return array An array of filters
*/
public function getFilters()
{
return array();
}

/**
* Returns a list of tests to add to the existing list.
*
* @return array An array of tests
*/
public function getTests()
{
return array();
}

/**
* Returns a list of functions to add to the existing list.
*
* @return array An array of functions
*/
public function getFunctions()
{
return array();
}
}
```

### YAML ###

`sfroute`
Expand All @@ -175,4 +260,4 @@ If you miss something, feel free to fork this repository and send a PR with your
[sublime]: http://www.sublimetext.com/
[symfony2]: http://www.symfony.com
[package_control]: http://wbond.net/sublime_packages/package_control
[package_control]: http://wbond.net/sublime_packages/package_control

0 comments on commit 4b6c412

Please sign in to comment.