Welcome Guest, Not a member yet? Register   Sign In
Template Library and DX_Auth Integration
#1

[eluser]Mithun[/eluser]
I uses DX Auth and Template Library http://www.williamsconcepts.com/ci/codei.../template/

I need set up a layout, there there is a user area that is displayed only for logged users. I have created the curresponding view in views/user_area.php and this view shows logged users name.

For getting this I need to setup the following code in every controller constructor.
Code:
$this->load->library(array('template', 'DX_Auth'));
        $data ['user_name'] = $this->dx_auth->get_username();
        $this->template->write_view('user_area','user_area', $data);
How can I make this automated? editing the Template library code or setting up different layous for login and non-login pages?

this is my template layout file
Code:
<html>
   <head>
      <title><?php echo $title; ?></title>
      <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/template.css" />
   </head>
    <body>
        <div id="wrapper">
            <div id="header">
                <div id="user_area">
                    &lt;?php echo $user_area;?&gt;
                </div>
                &lt;?php echo $header; ?&gt;
                <div id="tab_area">
                    &lt;?php echo $tab_area;?&gt;
                </div>
            </div>
            <div id="main">
                <div id="content">
                    &lt;?php echo $content; ?&gt;
                </div>
            </div>
            <div id="footer">
                &lt;?php echo $footer; ?&gt;
            </div>
        </div>
    &lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 12:59 AM
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 01:56 AM
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 03:10 AM
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 04:05 AM
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 04:12 AM
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 04:18 AM
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 04:25 AM
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 04:41 AM
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 05:22 AM
Template Library and DX_Auth Integration - by El Forum - 01-18-2010, 05:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB