Home > Backend Development > PHP Tutorial > 最近开发zen cart有些有关问题想咨询下

最近开发zen cart有些有关问题想咨询下

WBOY
Release: 2016-06-13 12:37:44
Original
773 people have browsed it

最近开发zen cart有些问题想咨询下!
最近在用zen cart商城系统做东西!看到了一下代码!
  function notify($eventID, $paramArray = array()) {
    $observers = & base::getStaticObserver();
    if (!is_null($observers))
    {
      foreach($observers as $key=>$obs) {
        if ($obs['eventID'] == $eventID) {
          $obs['obs']->update($this, $eventID, $paramArray);
        }
      }
    }
  }

  function & getStaticObserver() {
    return base::getStaticProperty('observer');
  }
在类里面每个function后面都会出现个& 是什么意思。
base::getStaticObserver()的意思应该是表示某类的方法!至于在前面加个&是引用么?
为什么在定义方法时也加个&
求大神详细解释下!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template