本文整理匯總了PHP中Connector::need方法的典型用法代碼示例。如果您正苦於以下問題:PHP Connector::need方法的具體用法?PHP Connector::need怎麽用?PHP Connector::need使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Connector
的用法示例。
在下文中一共展示了Connector::need方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getRequire
public function getRequire($path)
{
if ($this->exists($path)) {
return \Connector::need($path);
} else {
throw new FileNotFoundException($path);
}
}
示例2: in
public static function in($key)
{
$url = explode('.', $key);
$k = "";
$link = "";
if (count($url) >= 3) {
$j = 0;
for ($i = 0; $i < count($url) - 2; $i++) {
$link .= $url[$i] . "/";
$j = $i;
}
$j++;
$link .= $url[$j];
$k = $url[$j + 1];
} else {
$link .= $url[0];
$k = $url[1];
}
$files = \Connector::need(Application::$root . "app/links/{$link}.php");
//
return $files[$k];
}
示例3: call
protected static function call($info, $modelname)
{
if ((new Filesystem())->exists(Application::$root . $info)) {
\Connector::need(Application::$root . $info);
if ($modelname) {
\Connector::need(Application::$root . $modelname);
}
} else {
throw new AutoloadFileNotFoundException(Application::$root . $file);
}
}
示例4: import
/**
* View For Plugin
*/
public static function import($_plg, $_value_, $_data_ = null)
{
if (!is_null($_data_)) {
foreach ($_data_ as $_key_ => $_value2_) {
${$_key_} = $_value2_;
}
}
//getFile
$_name_ = str_replace('.', '/', $_value_);
//
$_link1_ = Plugins::getPath($_plg) . Plugins::getCore($_plg, "views") . '/' . $_name_ . '.php';
$_link2_ = Plugins::getPath($_plg) . Plugins::getCore($_plg, "views") . '/' . $_name_ . '.tpl.php';
//die($_link1_);
//
$_tpl_ = false;
//
if (file_exists($_link1_)) {
$_link3_ = $_link1_;
$_tpl_ = false;
} else {
if (file_exists($_link2_)) {
$_link3_ = $_link2_;
$_tpl_ = true;
} else {
throw new ViewNotFoundException($_name_);
}
}
if ($_tpl_) {
self::$showed = "tpl";
Template::show($_link3_, $_data_);
} else {
self::$showed = "smpl";
\Connector::need($_link3_);
}
}
示例5: call
protected static function call($info)
{
$file = $info["path"] . "/" . $info["autoload"]["file"];
//
if ((new Filesystem())->exists($file)) {
\Connector::need($file);
} else {
throw new AutoloadFileNotFoundException($file);
}
}