TP5 version of the session information how to output in the foreground

Source: Internet
Author: User

Basic usage of Session

assigning values

Assignment (current scope)
session::set (' name ', ' thinkphp ');
Assignment to the "Session::set" Scope
(' name ', ' thinkphp ', ' I ');

To determine whether there is

Determines whether (the current scope) assigns a value of
session::has (' name ');
To determine whether
the Session::has (' name ', ' see ') is assigned below the "I" scope;

Take value

Value (current scope)
session::get (' name ');
Takes
the value of the Session::get (' name ', ' it ');

Returns null if the value of name does not exist.

Delete

Delete (current scope) session
::d elete (' name ');
Delete the value under the "I" Scope session
::d elete (' name ', ' to be ');

Specify scope

Specifies the current scope session
::p refix (' I ' am ');

Take values and delete

Take value and delete session
::p ull (' name ');

Returns null if the value of name does not exist.

Empty

Clears the session (current scope)
session::clear ();
Clears the I
-scoped session::clear (' it ');
2. is a combined project

The problem I encountered here is the position of the front desk. It was written at the beginning {session::get (' variable name ')}

Because you want to change to TP5 format, see the foreground needs to use {$Request. Session.name} or {$Think. session.name} format, but I have used the PHP tag to use this will be the error, because he is the default resolution to <?php echo ...? > in the format. So I changed into this.

In the final analysis, the problem is the TP5 version of the session information how to output in the foreground, and in the output before the use of PHP preprocessing (such as some simple judgments of judgment).

I need a certain amount of time to improve myself, laziness is a very important factor, I think I can overcome these, because I can not endure such a weak self, I have to be a good enough person. Let's make a little progress, come on.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.