Skip to content

Instantly share code, notes, and snippets.

@vasilukwolf
Last active August 31, 2017 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vasilukwolf/7c863d26103fa56b0abde63c2518e8f5 to your computer and use it in GitHub Desktop.
Save vasilukwolf/7c863d26103fa56b0abde63c2518e8f5 to your computer and use it in GitHub Desktop.
Ошибка кода
<?php
public function changePassAction($slug)
{
$qb = $this->getDoctrine()->getConnection()->createQueryBuilder();
$qb->select('*')->from('user');
$qb->where('username = :slug');
$qb->orWhere('id = :slug');
$qb->setParameter(':slug',$slug );
$row = $qb->execute()->fetch();
$form = $this->createFormBuilder()
->add('pass_check', TextType::class,array('label' => 'Старый пароль'))
->add('pass', TextType::class,array('label' => 'Новый пароль'))
->add('repeat_pass', TextType::class,array('label' => 'Повторите пожалуйста пароль'))
->add('save', SubmitType::class, array('label' => 'Изменить пароль'))
->getForm();
return $this->render("WebBundle:Account:changepass.html.twig",
array(
'username'=> $row['username'],
'form' => $form->createView(),
'action' => $this->generateUrl(
'changePass',
array('slug' => $row['id'])),
'method' => 'POST',
));
}
{% extends "::base.html.twig" %}
{% block body %}
<h1>Смена пароля у пользователя {{ username }}</h1>
{{ form_start(form, {'action': path('changePass'), 'method': 'POST'}) }}
{{ form_widget(form) }}
{{ form_end(form) }}
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment