user1844054
user1844054

Reputation:

Issue in printing a session array variable

I have an peculiar session array variable,I need to pick one element to display on the screen.I'm not sure how to do that in smarty.Please give me the syntax how to manipulate the element in smarty.Here is the array values. I need to select ["school_name"] from the set.Please help

   array(6) {
     ["id"]=> string(32) "cb60942f64d2b7bae2076926ae430f1d"
     ["sa"]=> NULL ["start_cache_timer"]=> int(1377752940)  ["user"]=>
   array(17) {
      ["host_id"]=> string(1) "9"
      ["user_id"]=> string(2) "16"
      ["school_name"]=> string(10) "Joseph High School"
      ["code"]=> string(10) "2E4C5339F8"
      ["academic_id"]=>  string(2) "21"
      ["title"]=>  string(2) "Mr"
      ["first_name"]=>  string(3) "Jon"
      ["last_name"]=> string(7) "Bachura"
      ["name"]=> string(11) "Jon Bachura"
      ["email"]=> string(12) "[email protected]"
      ["role"]=> string(1) "1"
      ["times_login"]=> int(656)
      ["acc_status"]=> string(1) "3"
      ["user_status"]=> string(1) "3"
      ["admin_user_id"]=>
      string(2) "16"
      ["life"]=>
     array(2) {
     ["current"]=>
      int(1377756843)
      ["start"]=>
        int(1377756843)
       }
      ["training"]=>
      array(1) {
      ["start_time"]=>
     float(1377752946.14)
   }
   }
    ["mrole"]=>
     NULL
      ["extAjaxSession"]=>
    int(3)
     }

Upvotes: 0

Views: 494

Answers (1)

Borgtex
Borgtex

Reputation: 3245

Use $smarty.session:

$smarty.session.user.school_name

Upvotes: 1

Related Questions