小编djk*_*cts的帖子

PHP:self :: vs parent :: with extends

我想知道当静态子类扩展静态父类时,使用self ::和parent ::之间有什么区别

class Parent {

    public static function foo() {
       echo 'foo';
    }
}

class Child extends Parent {

    public static function func() {
       self::foo();
    }

    public static function func2() {
       parent::foo();
    }
}
Run Code Online (Sandbox Code Playgroud)

func()和func2()之间有什么区别吗?如果有,那么它是什么?

谢谢

问候

php static class parent self

19
推荐指数
1
解决办法
1万
查看次数

如何在一张ZingChart图表上绘制WeekOnWeek图表?

我试图在一个ZingChart图表上绘制两个线图,并努力弄清楚我应该以什么格式传递数据.

基本上,我有一个时间戳/整数对数组,用于今天和前一周的数据,间隔一小时,例如:

今天= [[timestamp1,1],[timestamp2,4],......,[timestamp18,7]] < - 假设现在是下午6点,所以当天剩下的时间没有数据

week_ago = [[timestamp1,4],[timestamp2,7],......,[timestamp23,1]] < - 全24小时数据

x系列应显示从00:00到23:00的小时数,y系列只是整数.此外,在每个图形点上,我希望工具提示显示日期和整数值.

这听起来很简单,可能是因为我对ZingChart很新,我无法理解.

非常感谢

charts plot date graph zingchart

7
推荐指数
1
解决办法
165
查看次数

标签 统计

charts ×1

class ×1

date ×1

graph ×1

parent ×1

php ×1

plot ×1

self ×1

static ×1

zingchart ×1