當前位置: 首頁>>代碼示例>>PHP>>正文


PHP H2o::addLookup方法代碼示例

本文整理匯總了PHP中H2o::addLookup方法的典型用法代碼示例。如果您正苦於以下問題:PHP H2o::addLookup方法的具體用法?PHP H2o::addLookup怎麽用?PHP H2o::addLookup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在H2o的用法示例。


在下文中一共展示了H2o::addLookup方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 public function render($context = array())
 {
     global $opac_authorities_templates_folder;
     if (!$opac_authorities_templates_folder) {
         $opac_authorities_templates_folder = "./includes/templates/authorities/common";
     }
     $template_path = $opac_authorities_templates_folder . "/" . $this->get_type_autority() . ".html";
     if (!file_exists($template_path)) {
         $template_path = "./includes/templates/authorities/common/" . $this->get_type_autority() . ".html";
     }
     if (file_exists($opac_authorities_templates_folder . "/" . $this->get_type_autority() . "_subst.html")) {
         $template_path = $opac_authorities_templates_folder . "/" . $this->get_type_autority() . "_subst.html";
     }
     if (file_exists($template_path)) {
         $h2o = new H2o($template_path);
         $h2o->addLookup(array($this, "lookup"));
         echo $h2o->render($context);
     }
 }
開發者ID:hogsim,項目名稱:PMB,代碼行數:19,代碼來源:authority.class.php

示例2: call_user_func_array

                            $obj = call_user_func_array(array($obj, $attribute), array());
                        } else {
                            if (method_exists($obj, "get_" . $attribute)) {
                                $obj = call_user_func_array(array($obj, "get_" . $attribute), array());
                            } else {
                                if (method_exists($obj, "is_" . $attribute)) {
                                    $obj = call_user_func_array(array($obj, "is_" . $attribute), array());
                                } else {
                                    $obj = null;
                                }
                            }
                        }
                    }
                } else {
                    $obj = null;
                    break;
                }
            }
        }
    }
    return $obj;
}
h2o::addTag(array("sqlvalue"));
h2o::addTag(array("sparqlvalue"));
h2o::addTag(array("tplnotice"));
h2o::addFilter(array('pmb_StringFilters'));
h2o::addFilter(array('pmb_DateFilters'));
H2o::addLookup("messagesLookup");
H2o::addLookup("globalLookup");
H2o::addLookup("recursive_lookup");
開發者ID:noble82,項目名稱:proyectos-ULS,代碼行數:30,代碼來源:pmb_h2o.inc.php

示例3: render

 public function render($context = array())
 {
     $template_path = "./includes/templates/authorities/" . $this->get_string_type_object() . ".html";
     if (file_exists("./includes/templates/authorities/" . $this->get_string_type_object() . "_subst.html")) {
         $template_path = "./includes/templates/authorities/" . $this->get_string_type_object() . "_subst.html";
     }
     if (file_exists($template_path)) {
         $h2o = new H2o($template_path);
         $h2o->addLookup(array($this, "lookup"));
         echo $h2o->render($context);
     }
 }
開發者ID:noble82,項目名稱:proyectos-ULS,代碼行數:12,代碼來源:authority.class.php

示例4: render

 private static function render($notice_id, $tpl)
 {
     $h2o = new H2o($tpl);
     $h2o->addLookup("record_display::lookup");
     $h2o->set(array('notice_id' => $notice_id));
     return $h2o->render();
 }
開發者ID:noble82,項目名稱:proyectos-ULS,代碼行數:7,代碼來源:record_display.class.php

示例5: count

        $notice_id = $query_stream->close();
        $notice_id = $notice_id + 0;
        $query = "select count(notice_id) from notices where notice_id=" . $notice_id;
        $result = mysql_query($query, $dbh);
        if ($result && mysql_result($result, 0)) {
            require_once "{$class_path}/notice_tpl_gen.class.php";
            $struct = array();
            $tpl = new notice_tpl_gen($this->id_tpl);
            $this->content = $tpl->build_notice($notice_id);
            $stream->write($this->content);
        }
    }
}
function globalLookup($name, $context)
{
    $global = str_replace(":global.", "", $name);
    if ($global != $name) {
        global ${$global};
        if (isset(${$global})) {
            return ${$global};
        }
    }
    return null;
}
h2o::addTag(array("sqlvalue"));
h2o::addTag(array("sparqlvalue"));
h2o::addTag(array("tplnotice"));
h2o::addFilter(array('pmb_StringFilters'));
h2o::addFilter(array('pmb_DateFilters'));
H2o::addLookup("globalLookup");
開發者ID:hogsim,項目名稱:PMB,代碼行數:30,代碼來源:pmb_h2o.inc.php

示例6: array

    {
        return array('h2o' => new H2o_Info());
    }
}
/**
 * Convient wrapper for loading template file or string
 * @param $name
 * @param $options - H2o options
 * @return Instance of H2o Template
 */
function h2o($name, $options = array())
{
    $is_file = '/([^\\s]*?)(\\.[^.\\s]*$)/';
    if (!preg_match($is_file, $name)) {
        return H2o::parseString($name);
    }
    $instance = new H2o($name, $options);
    return $instance;
}
function messagesLookup($name, $context)
{
    global $msg;
    $value = null;
    $code = str_replace(":msg.", "", $name);
    if ($code != $name && isset($msg[$code])) {
        $value = $msg[$code];
    }
    return $value;
}
H2o::addLookup("messagesLookup");
開發者ID:hogsim,項目名稱:PMB,代碼行數:30,代碼來源:h2o.php


注:本文中的H2o::addLookup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。