jms_serializer:
....
use JMS\Serializer\SerializerBuilder;
$serializer = SerializerBuilder::create()->build();
$ser_user = $serializer->serialize($user, 'json');
$series = base64_encode($this->secureRandom->nextBytes(64));
$tokenValue = base64_encode($this->secureRandom->nextBytes(64));
$this->tokenProvider->createNewToken(
new PersistentToken(
get_class($user = $token->getUser()),
$user->getUsername(),
$series,
$tokenValue,
new \DateTime()
)
);
$response->headers->setCookie(
new Cookie(
$this->options['name'],
$this->encodeCookie(array($series, $tokenValue)),
time() + $this->options['lifetime'],
$this->options['path'],
$this->options['domain'],
$this->options['secure'],
$this->options['httponly']
)
);
Users/roman/Development/Sites/uasector.dev/app/cache/dev/appDevDebugProjectContainer.php on line 5846
$telephone = $repository->findById($telephoneId);
$telephoneForm = $this->container->get('form.factory')->create(new TelephoneFormType(), $telephone);
class FirstEditForm extends .....
{
public function build($builder) {
$builder->add('username');
}
}
class SecondEditForm extends .....
{
public function build($builder) {
$builder->add('location');
$builder->add('number');
}
}
class MyUserBundle extends Symfony\Component\HttpKernel\Bundle\Bundle
{
public function getParent()
{
return 'FOSUserBundle';
}
}
namespace MyUserBundle\Controller;
use FOS\UserBundle\Controller\SecurityController as ParentSecurityController;
use Symfony\Component\HttpFoundation\RedirectResponse;
class SecurityController extends ParentSecurityController
{
public function loginAction()
{
if (!$this->container->get('security.context')->isGranted('IS_AUTHENTICATED_ANONYMOUSLY'))
{
return new RedirectResponse('/');
}
return parent::loginAction();
}