Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Twig extension
- class EventLogExtension extends \Twig_Extension
- {
- /**
- * @var RegistryInterface
- */
- private $doctrine;
- public function __construct(RegistryInterface $doctrine)
- {
- $this->doctrine = $doctrine;
- }
- public function getFunctions()
- {
- return [
- new \Twig_Function('get_event_log_count', \Closure::bind(function (User $user, $status) {
- return $this->getEventLogCount($user, $status);
- }, $this))
- ];
- }
- private function getEventLogCount(User $user, $status)
- {
- ...................
- }
- }
- ----------------------------
- view
- app/capmaign/partials/_menu_influencer.html.twig
- <a href="{{ path('influence_campaign_list', {'preset': 'accepted'}) }}"
- class="nav-link {% if app.request.get('preset') == 'accepted' %}active{% endif %}">
- {{ 'tab.offer.accepted'|trans({}, 'campaign') }} ({{ count_offers_by_status(app.user, 'accepted') }})
- </a>
- ////////////////////////////////////////////////////////////
- ({{ count_offers_by_status(app.user, 'accepted') }})
- ///////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement