로그인과 등록 양식과 동일한 작업에 참여하려고합니다. 이것은 내가 노력하고있어입니다 :Symfony : 같은 페이지에서 두 개의 양식을 결합하십시오.
모듈/miembros/actions.class.php/miembros/템플릿/auxSuccess.php
가<?php include_component('sfGuardRegister', 'register'); ?>
<?php include_component('sfGuardAuth', 'signin'); ?>
모듈/miembros/구성 요소
public function executeAux(sfWebRequest $request)
{
// I execute this action
}
모듈. class.php
public function executeSignin($request)
{
if ($request->isMethod('post') && ($request-
>getParameter('submit')=='signin')){
$this->form->bind($request->getParameter('login'));
if ($this->form->isValid()){
$this->getController()->getActionStack()->getLastEntry()->getActionInstance()->redirect('@home');
}
}
}
모듈/miembros/템플릿/_signin.php
,<form action="<?php echo url_for('miembros/aux?submit=signin') ?>"
method="post">
<?php echo $form['email_address']->renderLabel() ?>
<?php echo $form['email_address'] ?>
...
괜찮습니다.하지만 다른 대안이 있는지 알고 싶습니다.
예를 들어, 다음과 같은 행이 마음에 들지 않습니다. $ this-> getController() -> getActionStack() -> getLastEntry() -> getActionInstance() -> redirect ('@home');
감사
하비는
귀하의 의견을 토대로 새로운 제안이 있습니다. – ziiweb