Q:

Constraining tank_auth views to a div on a web age

Hi Tank_auth & web Gurus!
I have tank_auth working with my CodeIgniter application. Currently, the login/register views of tank_auth take over the entire screen. On my website, I would like the login/register views to occupy a div that I define. For example, I want the login/pw fields to just appear in the top right corner and not take over the whole screen...Can you point me in the right direction? - I read somewhere that I'd have to somehow constrain the view in a div but for the life of me I did not understand how!
Much obliged,
Mmiz

A:

Create div for the login. Create a view for the login. Populate the div with a javascript call to the view. 
<?php

//controller
//users.php
class Users {

//...

    public function div_login()
    {
        $this->load->view('div_login_view.php');
    }

//...

//------------------------------------------

//view
//div_login_view.php
echo form_open('users/login');
echo form_input('username');
echo form_password('password');
echo form_submit('Login');
echo form_close();

//------------------------------------------

//index page (or whatever page you want the form on)

<div id="login_div"></div>

<script type="text/javascript">

    $(document).ready(function(){
        var login_form = $.get('/users/div_login');
        if (login_form.status === 200){
            $('#login_div').html(login_form.responseText)
        }else{
            alert('There was an error getting the login form.');
        }
    })
</script>

