Working with popups and such in a class

Posted on 16th Feb 2014 by admin

I've recently started building my applications completely enclosed in classes. I like the fact that I can base everything off one root and work with that, but I'm having a problem with popups (Facebox) and getting the application working with the popup.

Currently what I have is a class for users, within that users class all my user SESSIONS get handled, login/logout actions, and my login, register, and forgot password templates are included through a get() function within the class.

I also have the main class. Here's a quick example

class main()
{
public function __construct()
{
require_once(MAIN_PATH.'plugins/users/users.php');
$this->USERS = new USERS;
}
}

When i include the login page I'm calling it like this
$this->USERS->get('tmpl','login');

Which works, everything works good, but the problem is when I popup the register and forgot in the facebox. I have a helper.php that I popup with a $_GET global tmpl that will equal either register or forgot, and through that I want to be able to do $this->USERS->get('tmpl',$_GET['tmpl']).

I don't know if I'm explaining this right but if anyone had some hints or a tutorial on how I deal with popups and still having everything within my class. My ultimate goal is to make it as if that popup was basically the same as being apart of the page, where I can access everything since as I would normally be able too.

Thanks

Other forums