this裡面的這個是什麼意思?

來源:互聯網
上載者:User
$this->set_current_page( $page )這句裡面的set_current_page是什麼意思呢?
這個不是屬性是方法吧 前面也沒有定義啊

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'] );    }    }

回複內容:

$this->set_current_page( $page )這句裡面的set_current_page是什麼意思呢?
這個不是屬性是方法吧 前面也沒有定義啊

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'] );    }    }

兩種可能:

1.你沒有把代碼看全,下面有這個類方法;

2.這個類是不是繼承了其他類,即:

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

這個類沒有繼承嗎?

類或父類的方法set_current_page

這個好像是ThinkPHP裡面的資料庫操作

有一種可能是 需要子類實現

你代碼應該沒有看全,有繼承別的類,或者下方有實現該方法.單單是這樣的話 php 是會自己報錯的

你代碼應該沒有看全,有繼承別的類,或者下方有實現該方法.單單是這樣的話 php 是會自己報錯的

  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.