Skip to content

Instantly share code, notes, and snippets.

@ger86
Last active March 7, 2019 10:52
Show Gist options
  • Save ger86/dbf3243456974638181d7c020046b984 to your computer and use it in GitHub Desktop.
Save ger86/dbf3243456974638181d7c020046b984 to your computer and use it in GitHub Desktop.
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use App\Repository\StripePlanRepository;
class ChooseSubscriptionController extends AbstractController {
/**
* Creates a form to choose subscription
*
* @param StripePlanRepository $stripePlanRepository
* @param string $stripePublicApiKey
* @return Response
*/
public function __invoke(
StripePlanRepository $stripePlanRepo,
string $stripePublicApiKey
): Response {
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$stripePlans = $stripePlanRepo->findAll();
return $this->render('views/stripe_choose_subscription.html.twig', [
'stripePlans' => $stripePlans,
'stripePublicApiKey' => $stripePublicApiKey
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment