-
-
Save vasilukwolf/7c863d26103fa56b0abde63c2518e8f5 to your computer and use it in GitHub Desktop.
Ошибка кода
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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', | |
)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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