What does this mean?

Source: Internet
Author: User
$ This-& amp; gt; set_current_page ($ page) What does set_current_page mean? This is not an attribute. It is a method. It is not defined before. {code...} $ this-> set_current_page ($ page). What does set_current_page mean?
This is not an attribute. It is a method. It is not defined before.

class Java_Pagination{    protected $_total = 0;    protected $_total_page = 0;    protected $_page = 1;    protected $_page_size = 10;    protected $_link = '';    protected $_grep = 3;     protected $_admin = false;    protected $_css_next = 'next-page';    protected $_css_prev = 'prev-page';    protected $_css_curr = 'curr-page';    protected $_css_page = 'page-nav inline-block';     public function __construct ( $page, $page_size, $total, $admin = false )    {        $this->set_current_page( $page );        $this->set_page_size( $page_size );        $this->set_total( $total );         if ( $admin )        {            $this->_admin = $admin;        }        //$this->_link = $_SERVER['REQUEST_URI'];        $this->set_link( $_SERVER['REQUEST_URI'] );    }    }

Reply content:

$ This-> set_current_page ($ page) What does set_current_page mean?
This is not an attribute. It is a method. It is not defined before.

class Java_Pagination{    protected $_total = 0;    protected $_total_page = 0;    protected $_page = 1;    protected $_page_size = 10;    protected $_link = '';    protected $_grep = 3;     protected $_admin = false;    protected $_css_next = 'next-page';    protected $_css_prev = 'prev-page';    protected $_css_curr = 'curr-page';    protected $_css_page = 'page-nav inline-block';     public function __construct ( $page, $page_size, $total, $admin = false )    {        $this->set_current_page( $page );        $this->set_page_size( $page_size );        $this->set_total( $total );         if ( $admin )        {            $this->_admin = $admin;        }        //$this->_link = $_SERVER['REQUEST_URI'];        $this->set_link( $_SERVER['REQUEST_URI'] );    }    }

There are two possibilities:

1. You didn't fully understand the code. The class method is available below;

2. Does this class inherit other classes, namely:

class Java_Pagination extends SomeClass{    //your code...}

Is this class not inherited?

Set_current_page

This seems to be a database operation in ThinkPHP.

One possibility is that subclass implementation is required.

Your code should not be fully-viewed, there are inherited classes, or there are implementation methods below. In this case, php will report its own errors.

Your code should not be fully-viewed, there are inherited classes, or there are implementation methods below. In this case, php will report its own errors.

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.