PlanExtension
extends AbstractExtension
in package
Expose dans les templates les règles de plan d'abonnement portées par `PlanService`.
Fonctions Twig, déléguées directement aux méthodes homonymes de
PlanService :
has_feature(feature: string): bool— exemple :{% if has_feature('qr_code') %}.can_create_more_cards(user: User): bool— exemple :{% if can_create_more_cards(app.user) %}.get_remaining_cards(user: User): int— exemple :{{ get_remaining_cards(app.user) }}.can_use_premium_features(user: User): bool— exemple :{% if can_use_premium_features(app.user) %}.get_user_plan(user: User): ?Plan— exemple :{{ get_user_plan(app.user).name }}.can_upgrade(user: User, targetPlan: Plan): bool— exemple :{% if can_upgrade(app.user, plan) %}.
getFunctions() contient en outre un appel new TwigFunction('') sans
callback, manifestement incomplet : cette entrée ne correspond à aucune
fonction exploitable et n'est pas documentée ici.
Table of Contents
Properties
Methods
- __construct() : mixed
- getFunctions() : array<string|int, mixed>
Properties
$planService
private
PlanService
$planService
Methods
__construct()
public
__construct(PlanService $planService) : mixed
Parameters
- $planService : PlanService
getFunctions()
public
getFunctions() : array<string|int, mixed>