Welcome Guest, Not a member yet? Register   Sign In
Var not passed to a page question
#1

[eluser]R_Nelson[/eluser]
my basic function for a page loos about like this
Code:
$data['title'] = 'Home Page';
        $data['discription'] = '';
        $data['keyword'] = '';    
        $data['main_content'] = 'site/index';        
        $data['query'] = $this->db->get('blog');
        $this->load->view('includes/template', $data); // calls template

how can i set say $data['username'] = '' without have to put it in the functions that are not used?

the reason im asking is when im on say the login page i dont want to have to load a blank left or right panel!
#2

[eluser]InsiteFX[/eluser]
You could create different templates to use.

template_1col.php
template_2col.php
template_3col.php

And then load the one you need.

InsiteFX
#3

[eluser]R_Nelson[/eluser]
so theirs no way to make them like a global variable or pass them as a reference?




Theme © iAndrew 2016 - Forum software by © MyBB