duaevb1511 2017-12-30 13:22
浏览 239
已采纳

如何在同一个类的静态方法中访问类的受保护变量?

Below is the scenario:

class PopupsAdminSettingsPage extends AbstractAdminSubPage
{
    protected $menuTitle = 'Settings';

    public static function getMenuTitle()
    {
        /* I want to access $menuTitle property here ...
    }
}

I want to access the $menuTitle property inside the static function getMenuTitle so that I could access the protected variable outside of the Class PopupsAdminSettingsPage too.

  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 MATLAB 调用comsol如何加速设计?
      • ¥15 echarts地图添加点击事件
      • ¥15 不知道带什么标题好随便搞一个吧
      • ¥15 ffmpeg 图片合成视频
      • ¥15 软科大学爬取获取所有数据
      • ¥15 如何修改损失函数以及代码讲解
      • ¥15 有偿咨询!!程序的小数点怎么取到后四位啊!
      • ¥15 IRS智能反射面相关文章代码
      • ¥15 landsat5的两幅影像镶嵌前波段是123457,为什么镶嵌后波段变成了123456?
      • ¥15 关于#matlab#中fmincon函数如何处理约束问题?