0
Hello!
I want to display a die($variable) on a footer.
The way it is below, it works and the variable $operador
is displayed correctly on all options/screens I click.
<?php $operador = $this->session->userdata('nome'); ?>
<div id="footer" class="span12"> <?php echo date('Y'); ?> | Versão: <?php echo $operador; ?>
But I don’t want to show a $variável
of the Second.
Then I created a controller/modal/view called SYSTEM.
In this controller I have the idSistema, nome, data_registro, date_expiracao, licenca, versao
.
So I want to show on the footer version.
So I tried it this way:
<div id="footer" class="span12"> <?php echo date('Y'); ?> | Versão: <?php foreach ($results as $r) { echo $r->versao; }?></div>
But this only works if I’m on the option SYSTEM, if I click another option, where I should display the system version, the message is displayed that the Results variable was not defined.
How can I set this variable to global??
Below, part of the function code in the system controller.
$this->data['results'] = $this->sistemas_model->get('sistemas','idSistemas,nome, dt_registro,dt_expiracao,licenca,versao','',$config['per_page'],$this->uri->segment(3));
$this->data['view'] = 'sistemas/sistemas';
$this->load->view('tema/topo',$this->data);
I wanted to help you but I didn’t understand it right. I didn’t understand what you mean by global variable. Who has $this->data['Results']? Need to do the
foreach
? It just doesn’t solve:<div id="footer" class="span12"> <?php echo date('Y'); ?> | Versão: <?php echo $results->versao ?></div>
– user26552
Does not work.. version is coming from array.. For this reason I put the foreach.
– Wagner Fillio
I want to transform the values of Results on global variables like Session, which I can get the values on any page.
– Wagner Fillio
what version of codeigniter?
– RFL
The application is in version 2
– Wagner Fillio