Skip to content

Instantly share code, notes, and snippets.

@khepin
Created June 20, 2012 11:03
Show Gist options
  • Save khepin/2959369 to your computer and use it in GitHub Desktop.
Save khepin/2959369 to your computer and use it in GitHub Desktop.
<?php
class SomeController
{
public function checkoutAction(){
$user = $this->get('security.context')->getToken()->getUser();
$errors = $this->get('validator')->validate($user, 'ticket_checkout');
if(count($errors) > 0) {
// Add a warning message to the session
// Redirect user to a profile edit page where he can setup the missing info
return new RedirectResponse('http://mywebsite.com/update_your_profile');
}
// proceed to checkout
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment