Skip to content

Instantly share code, notes, and snippets.

@havvg
Created July 12, 2012 15:55
Show Gist options
  • Save havvg/3098997 to your computer and use it in GitHub Desktop.
Save havvg/3098997 to your computer and use it in GitHub Desktop.
Example tagged map services
<?php
namespace Havvg\Bundle\DashboardBundle\DependencyInjection\Compiler;
use Havvg\Bundle\DRYBundle\DependencyInjection\Compiler\AbstractTaggedMapCompilerPass;
class DashboardPass extends AbstractTaggedMapCompilerPass
{
protected $mapServiceTag = 'havvg_dashboard.boardlet';
protected $targetServiceTag = 'havvg_dashboard.dashboard';
protected $targetMethod = 'add';
}
services:
dashboard.default:
class: Havvg\Bundle\DashboardBundle\Dashboard\Dashboard
tags:
- { name: 'havvg_dashboard.dashboard', alias: 'default' }
boardlet.lead_distribution:
class: Ormigo\Bundle\ReportingBundle\Dashboard\Boardlet\LeadDistributionBoardlet
tags:
- { name: 'havvg_dashboard.boardlet', target: 'default' }
dashboard.business_intel:
class: Havvg\Bundle\DashboardBundle\Dashboard\Dashboard
tags:
- { name: 'havvg_dashboard.dashboard', alias: 'business_intel' }
boardlet.premium_accounts:
class: Ormigo\Bundle\ReportingBundle\Dashboard\Boardlet\PremiumAccountsBoardlet
tags:
- { name: 'havvg_dashboard.boardlet', target: 'business_intel' }
@havvg
Copy link
Author

havvg commented Jul 12, 2012

This will call add on each Dashboard for all Boardlet services on their respective target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment