PHP类语法错误 - Codeigniter

时间:2015-07-06 16:13:58

标签: php codeigniter

出于某种原因,每当我通过控制器运行此代码时,我都会收到此错误:

  

解析错误:语法错误,意外'(',期待','或&#39 ;;'在第9行的Pagination.php

这是代码 - 第9行是" ceil"功能:

class Pagination {
    //The total number of objects that need to paginated
    private $numObjects;
    //The number of objects per page of pagination
    private $objectsPerPage;
    //Total number of pages
    public $numPages = ceil( $numObjects / $objectsPerPage );
    //Number of objects on last page
    public $objectsLastPage = $numObjects % $objectsPerPage;



    //constructor function to populate variables. 
    public function __construct( $numObjects, $objectsPerPage ) {
        $this->numObjects = $numObjects;
        $this->objectsPerPage = $objectsPerPage;
    }
    //end constructor
}
//end Pagination

这是我的控制器代码,我运行它:

$params = array ( 20, 10 );

$this->load->library('pagination', $params);

0 个答案:

没有答案