本文整理汇总了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);
}
}