Skip to content

ixmedia/SkiiTwigHelpersMacros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkiiTwigHelpersMacros

List of useful Twig Macros helpers

Installation

To use with Symfony 2.0.x add this in your deps file:

[SkiiTwigHelpersMacros]
	git=http://github.com/ixmedia/SkiiTwigHelpersMacros.git
	target=bundles/Skii/Bundle/TwigHelpersMacrosBundle

Be sure to have it loaded in your Symfony App/AppKernel.php file like this:

class AppKernel extends Kernel
{
	public function registerBundles()
	{
		$bundles = array(
			…
			new Skii\Bundle\TwigHelpersMacrosBundle\SkiiTwigHelpersMacrosBundle(),
		);
		return $bundles;
	}
	…
}

Usage

Import in your template

And just import it in your Twig template as needed:

{% import 'SkiiTwigHelpersMacrosBundle::helpers.html.twig' as skiiHelpers %}

Call any helpers where you need it

For example in a Twig template adding this:

{{ skiiHelpers.tw_follow_btn('iXmedia') }}

Will output something like that:

Follow iXmedia

TODO

License

© 2012 iXmédia and licensed under the MIT license.

About

A growing list of usefull Twig Macros helpers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages