So, I'm kind off new to frameworks and to Phalcon PHP. I have this "login/signup" modal. If I register or login I want to call my registerAction() in the UsersController. The problem is that the modal should be called from anywhere in my website so for that reason I can't really change the URL to use routing to access my controller actions. I'm not sure what the best solution for my modal problem is. I'll post the modal code below. Hope someone knows about the best to use solution.
{#Login button#}
<ul class="nav navbar-nav pull-right">
<li><a href="users" data-toggle="modal" data-target="#login-modal1">Login</a></li>
</ul>
{#Login pop-up#}
<div class="modal" id="login-modal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="loginmodal-container" id="hide">
<h1>Login to Your Account</h1><br>
<form method="post">
<input type="text" name="" placeholder="Username" />
<input type="password" name="" placeholder="Password" />
<input type="submit" name="" class="login loginmodal-submit" value="Login" />
</form>
<div class="login-help">
<a data-dismiss="modal" data-toggle="modal" data-target="#login-modal2" href="users">Register</a> - <a href="#">Forgot Password</a>
</div>
</div>
</div>
</div>
<div class="modal" id="login-modal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria- hidden="true">
<div class="modal-dialog">
<div class="loginmodal-container">
<h1>Register</h1><br>
<form method="post">
<input type="text" name="user" placeholder="Username" />
<input type="password" name="password" placeholder="Password" />
<input type="password" name="email" placeholder="E-Mail" />
<input type="submit" name="login" class="login loginmodal-submit" value="Register" />
</form>
<div class="login-help">
Already have an account? <a data-dismiss="modal" data-toggle="modal" data-target="#login-modal1">Sign in</a>
</div>
</div>
</div>
</div>