Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vjousse/taghelperbundle
Symfony 2 tag helper, will convert $view->tag->tag('div#test.toto', 'foo'); to <div id="test" class="toto">foo</div>
https://github.com/vjousse/taghelperbundle
Last synced: about 1 month ago
JSON representation
Symfony 2 tag helper, will convert $view->tag->tag('div#test.toto', 'foo'); to <div id="test" class="toto">foo</div>
- Host: GitHub
- URL: https://github.com/vjousse/taghelperbundle
- Owner: vjousse
- License: mit
- Created: 2010-03-21T13:34:27.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2010-11-27T18:01:23.000Z (about 14 years ago)
- Last Synced: 2024-10-08T04:21:49.004Z (3 months ago)
- Language: PHP
- Homepage: http://diem-project.org/diem-5-0/doc/en/reference-book/template-helpers#tag-helpers:_tag-create-a-tag
- Size: 105 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
TagHelperBundle
========================================================Overview
--------Just a simple Bundle which allow you to use the Diem tag helper in a Symfony2 project. See http://diem-project.org/diem-5-0/doc/en/reference-book/template-helpers#tag-helpers:_tag-create-a-tag for more details.
Basically this code :
[php]
echo $view['tag']->tag('div#test.toto', 'Foo');Will output :
`
Foo`Requirements
------------You will need the PR3 version of Symfony2. You can get the sandbox from github here: http://github.com/symfony/symfony-sandbox/tree/PR3
Installation
------------
* Install the bundle in src/Bundle
$ cd src/Bundle
$ git clone git://github.com/vjousse/TagHelperBundle.git
* In your Application kernel (HelloKernel.php for the sandbox) your registerBundles method should be something like this:
[php]
public function registerBundles()
{
$bundles = array(
new Symfony\Framework\KernelBundle(),
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\ZendBundle\ZendBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
//new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(),
//new Symfony\Bundle\DoctrineMongoDBBundle\DoctrineMongoDBBundle(),
//new Symfony\Bundle\PropelBundle\PropelBundle(),
//new Symfony\Bundle\TwigBundle\TwigBundle(),
new Application\HelloBundle\HelloBundle(),
new Bundle\TagHelperBundle\TagHelperBundle(),
);if ($this->isDebug()) {
}return $bundles;
}
Usage
-----In your config.yml file, you'll have to declare that you will 'use' the helper
tag.config: ~
You're done ! You can do something like this in a template:
[php]
echo $view['tag']->tag('div#test.toto', 'Foo');
It will output : `Foo`
Detailed documentation
----------------------This helper is a port of the Diem tag helper, the documentation can be found here: http://diem-project.org/diem-5-0/doc/en/reference-book/template-helpers#tag-helpers:_tag-create-a-tag