$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 是會自己報錯的