严重性:8192消息:与类相同名称的方法在将来的PHP版本中将不再是构造函数; [英] Severity: 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP;

查看:45
本文介绍了严重性:8192消息:与类相同名称的方法在将来的PHP版本中将不再是构造函数;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

严重性:8192

消息:与类相同名称的方法在以后的PHP版本中将不再是构造函数; CI_Pagination具有不推荐使用的构造函数

Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Pagination has a deprecated constructor

文件名:libraries / Pagination.php

Filename: libraries/Pagination.php

class CI_Pagination {

    var $base_url           = ''; // The page we are linking to
    var $total_rows         = ''; // Total number of items (database results)
    var $per_page           = 10; // Max number of items you want shown per page
    var $num_links          =  2; // Number of "digit" links to show before/after the currently viewed page
    var $cur_page           =  0; // The current page being viewed
    var $first_link         = '‹ First';
    var $next_link          = '>';
    var $prev_link          = '<';
    var $last_link          = 'Last ›';
    var $uri_segment        = 3;
    var $full_tag_open      = '';
    var $full_tag_close     = '';
    var $first_tag_open     = '';
    var $first_tag_close    = ' ';
    var $last_tag_open      = ' ';
    var $last_tag_close     = '';
    var $cur_tag_open       = ' ';
    var $cur_tag_close      = '';
    var $next_tag_open      = ' ';
    var $next_tag_close     = ' ';
    var $prev_tag_open      = ' ';
    var $prev_tag_close     = '';
    var $num_tag_open       = ' ';
    var $num_tag_close      = '';
    var $page_query_string  = FALSE;
    var $query_string_segment = 'per_page';


推荐答案

以前,我们曾经使用类名来声明类构造函数本身

Previously we used to declare class constructor using the class name itself

Class A
{

public function a(){
}
}

现在,您需要像这样更改a()来构造

Now you need to change a() to construct, like this

public function __construct(){
}

错误将消失。

这篇关于严重性:8192消息:与类相同名称的方法在将来的PHP版本中将不再是构造函数;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆