du8794 2010-02-11 16:06
浏览 12
已采纳

在这种情况下如何找到PHP中函数的实现位置?

I was just traversing the workflow of zend framework and cant really find where the function "findByUri()" is located, I found the class it belongs , simply dumping it, but going through the hierarchy of that class(parents , interfaces and so forth) I cant really find it. I found where it is called from

....
 call_user_func_array(
            array($this->getContainer(), $method),
            $arguments);
    ...

but it is not in there (the class that GetContainer() returns)

any Idea, I know u can assign a variable to class simple by $class->someVar =...; But never had done it with class functions... Thanks

  • 写回答

4条回答 默认 最新

  • duanhe6718 2010-02-11 16:27
    关注

    There is no method by this name in the entire ZF. It's probably a magic accessor done within a __call method of $this->container. I take the snippet you provided is from Zend_View_Helper_Navigation_HelperAbstract, so it should be any of the classes belonging to the Zend_Navigation package.

    EDIT
    From the ZF Reference Manual on Zend_Navigation containers:

    Containers have finder methods for retrieving pages. They are findOneBy($property, $value), findAllBy($property, $value), and findBy($property, $value, $all = false). Those methods will recursively search the container for pages matching the given $page->$property == $value. The first method, findOneBy(), will return a single page matching the property with the given value, or NULL if it cannot be found. The second method will return all pages with a property matching the given value. The third method will call one of the two former methods depending on the $all flag.

    The finder methods can also be used magically by appending the property name to findBy, findOneBy, or findAllBy, e.g. findOneByLabel('Home') to return the first matching page with label Home. Other combinations are findByLabel(...), findOnyByTitle(...), findAllByController(...), etc. Finder methods also work on custom properties, such as findByFoo('bar').

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等