如何使用路径Twig函数在Symfony2中调用另一个bundle和routing.yml

时间:2014-07-28 05:03:48

标签: php symfony twig

我想从我的登录界面为用户注册注册。我有两个单独的包:LoginBundle和RegisterBundle。如果有人能为此提出一些观点,我会感激不尽,谢谢你。

我的登录表格是这样的:

{% block body %}

<h1 class="title">Login</h1>
<p>
    Choose between two default users: <em>user/userpass</em> <small>(ROLE_USER)</small> or <em>admin/adminpass</em> <small>(ROLE_ADMIN)</small>
</p>

<div class="error"></div>

<div class="wrapper">
<form action="{{ path('login_process') }}" method="post" id="login" class="form-signin">       
  <input type="text" id="username" name="_username" value="{{ last_username }}" class="form-control"  placeholder="Email Address" required="" autofocus="" />
  <input type="password" id="password" name="_password"  class="form-control" name="password" placeholder="Password" required=""/>      
  <label class="checkbox">
    <input type="checkbox" value="remember-me" id="rememberMe" name="rememberMe"> Remember me
  </label>
  <button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>
  <a href="{{ path('register') }}" targer='_blank'>Register</a>   
</form>
</div>
{% endblock %}

0 个答案:

没有答案