Welcome Guest, Not a member yet? Register   Sign In
Session question?
#7

[eluser]Unknown[/eluser]
hey guy!

you can use the session variables in any view or controller file.

like this:

Code:
<?= $this->session->userdata('name'); ?>

but if you have normal variables or arrays, what ever, you must turn over the data, most suitable, to the controller.

like this:

Controller test.php

Code:
<?php
    class Test extends Controller {
          
        function index()
        {
        
        //You can define such $data variables you want.
        $data['test'] = "";
        
        //Here you load the view file test_output and give over $data
        $this->load->view('test_output.php', $data);
        }
    }

?>

View test_output.php

Code:
Data: &lt;?= $test; ?&gt; and maybe a wee bit <b>html</b>

It`s better to display the informations only in view files and the conditioning of the informations in controllers, models...

greetz chichi


Messages In This Thread
Session question? - by El Forum - 08-08-2007, 09:42 AM
Session question? - by El Forum - 08-08-2007, 11:16 AM
Session question? - by El Forum - 08-08-2007, 12:17 PM
Session question? - by El Forum - 08-08-2007, 12:46 PM
Session question? - by El Forum - 08-08-2007, 07:17 PM
Session question? - by El Forum - 08-09-2007, 02:13 AM
Session question? - by El Forum - 08-10-2007, 04:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB