Write a simple PHP action tip class _php Tutorial

Source: Internet
Author: User
In the design of some systems, often need to give users to operate the prompt. This hint is important, and friendly hints can improve the user's goodwill towards the system. Operation Tips There are a lot of designs, here is a humble plan for me, just a tip.

Action Tip class: Tips_class.php

 
  Tips = "
 
   $string return (auto return after 4 seconds)", return $this->tips; Public Function __tostring () {        return $this->tips;    } Private Function __clone () {}public static function get_tips ($string, $url) {if (FALSE = = (Self::$_instance instanceof Self ) {self::$_instance = new self ($string, $url);} return self::$_instance;}    ? >

This class is simple enough to jump to a link after 4 seconds, or click to jump to that link.

__tostring () This function is very important, it can implement the string output of the class object.

How do you use this class?

Include_once ("./tips_class.php"); $hit = "Error: Two passwords entered are inconsistent"; $jump = ". /login.php "; Echo $tips = Tips::get_tips ($hit, $jump);

http://www.bkjia.com/PHPjc/752521.html www.bkjia.com true http://www.bkjia.com/PHPjc/752521.html techarticle in the design of some systems, often need to give users to operate the prompt. This hint is important, and friendly hints can improve the user's goodwill towards the system. Operation tips There are many designs ...

  • 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.