[eluser]daGrevis[/eluser]
Hey,
I'm new to CI and just faced a problem... You see, I'm creating users system. User's data I store in session. I'm trying to make variable that stores username of user if session exist (if user is signed in) or just string "guest" if else. Then I wanted to pass this variable to view and print it... )
Here's line of code that throws error (it's controller):
Code:
$data['message'] = isSet( $this -> session -> userdata( 'username' ) ) ? $this -> session -> userdata( 'username' ) : 'guest';
Here's view...
Code:
<?php echo "<p>Hey, <strong>{$username}</strong>!</p>"; ?>
<br />