Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

Provides ability in Twig templates to determine if an action is being requested

License

Notifications You must be signed in to change notification settings

bravesheep/active-link-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BravesheepActiveLinkBundle

This bundle provides a few Twig helper functions and filters for checking whether or not a specific part of your controller structure is active.

Note that some limitations apply, specifically this bundle does not work well with subrequests. Instead the bundle always requests the master request.

Installation

Using Composer add the bundle to your requirements:

{
    "require": {
        "bravesheep/active-link-bundle": "dev-master"
    }
}

Then run composer update bravesheep/active-link-bundle. Finally add the bundle in app/AppKernel.php:

public function registerBundles()
{
    return array(
        // ...
        new Bravesheep\ActiveLinkBundle\BravesheepActiveLinkBundle(),
        // ...
    );
}

Available twig functions

  • active(location[, params])
  • active_route(route[, params])
  • active_bundle(bundle[, params])
  • active_controller(controller[, params])
  • active_action(action[, params])

Available twig filters

  • location is active([params])
  • route is active_route([params])
  • bundle is active_bundle([params])
  • controller is active_controller([params])
  • action is active_action([params])

About

Provides ability in Twig templates to determine if an action is being requested

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages