本文整理匯總了PHP中Hooks::define方法的典型用法代碼示例。如果您正苦於以下問題:PHP Hooks::define方法的具體用法?PHP Hooks::define怎麽用?PHP Hooks::define使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Hooks
的用法示例。
在下文中一共展示了Hooks::define方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: favoriteController
return self::$db->query($Query);
}
static function favoriteController()
{
$favRes = self::query("SELECT * FROM `favorites`");
while ($Fav = $favRes->fetchArray()) {
if (!is_dir($Fav['value'])) {
self::deleteFavorite($Fav['value']);
}
}
return true;
}
static function querySingle($Query, $Bool = false)
{
return self::$db->querySingle($Query, $Bool);
}
static function isFavorite($path)
{
if (!is_dir($path)) {
return false;
}
$path = realpath($path);
if (self::$db->querySingle("SELECT * FROM `favorites` WHERE `value` = '{$path}'", TRUE)) {
return true;
}
return false;
}
}
Hooks::define("Loader", "DBLite::init");
Hooks::define("Loader", "DBLite::favoriteController");
示例2: array
<input name="var" type="text" style="width: 80%; margin-bottom: 8px;" value="http://" />
', array("style" => "text-align: center;")) . Html::writef("ListSubmit", array("Content" => '
<input type="submit" value="Bağlan ve İndir" />
')) . '
</form>
';
$NavigateDir = null;
if (is_dir(DIRECTORY)) {
if (DIRECTORY == "/") {
$NavigateDir = '<a href="' . URLy::url("folderView", array("dir" => "/")) . '">/ {Kök} </a>';
} else {
$directoryPath = File::pathListing(DIRECTORY);
$countDP = 0;
foreach ($directoryPath as $dP) {
$dP[0] = $dP[0] == "" ? '<span style="color: green;">/</span>' : $dP[0];
$dP[1] = $dP[1] == "" ? '/' : $dP[1];
if ($countDP > 0) {
$NavigateDir .= ' <b>></b> ';
}
$NavigateDir .= '<a href="' . URLm::url("folderView", array("dir" => $dP[1])) . '">' . $dP[0] . '</a>';
$countDP++;
}
}
}
Page::write("Bottom", array("DirNavigation" => $NavigateDir));
}
}
}
Hooks::define("Loader", "FMApp::Constructor");
Hooks::define("Loader", "FMApp::CompleteStructure");