本文整理匯總了PHP中BlockType::getPackageHandle方法的典型用法代碼示例。如果您正苦於以下問題:PHP BlockType::getPackageHandle方法的具體用法?PHP BlockType::getPackageHandle怎麽用?PHP BlockType::getPackageHandle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BlockType
的用法示例。
在下文中一共展示了BlockType::getPackageHandle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getBlockTypeAssetsURL
/**
* Gets a full URL to the directory containing all of a block's items, including JavaScript, tools, icons, etc...
* @param BlockType $bt
* @return string $url
*/
public function getBlockTypeAssetsURL($bt, $file = false)
{
$ff = '';
if ($file != false) {
$ff = '/' . $file;
}
if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $bt->getBlockTypeHandle() . $ff)) {
$url = DIR_REL . '/' . DIRNAME_BLOCKS . '/' . $bt->getBlockTypeHandle() . $ff;
} else {
if ($bt->getPackageID() > 0) {
$db = Loader::db();
$h = $bt->getPackageHandle();
$dirp = is_dir(DIR_PACKAGES . '/' . $h) ? DIR_PACKAGES . '/' . $h : DIR_PACKAGES_CORE . '/' . $h;
if (file_exists($dirp . '/' . DIRNAME_BLOCKS . '/' . $bt->getBlockTypeHandle() . $ff)) {
$url = is_dir(DIR_PACKAGES . '/' . $h) ? DIR_REL : ASSETS_URL;
$url = $url . '/' . DIRNAME_PACKAGES . '/' . $h . '/' . DIRNAME_BLOCKS . '/' . $bt->getBlockTypeHandle() . $ff;
}
} else {
if (file_exists(DIR_FILES_BLOCK_TYPES_CORE . '/' . $bt->getBlockTypeHandle() . $ff)) {
$url = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $bt->getBlockTypeHandle() . $ff;
}
}
}
return $url;
}