本文整理匯總了PHP中XenForo_Link::prepareExtensionAndAction方法的典型用法代碼示例。如果您正苦於以下問題:PHP XenForo_Link::prepareExtensionAndAction方法的具體用法?PHP XenForo_Link::prepareExtensionAndAction怎麽用?PHP XenForo_Link::prepareExtensionAndAction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XenForo_Link
的用法示例。
在下文中一共展示了XenForo_Link::prepareExtensionAndAction方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildLink
/**
* Method to build a link to the specified page/action with the provided
* data and params.
*
* @see XenForo_Route_BuilderInterface
*/
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if ($data) {
XenForo_Link::prepareExtensionAndAction($extension, $action);
$actionParts = explode('/', $action, 2);
$url = $outputPrefix . '/' . $actionParts[0];
switch (strtolower($actionParts[0])) {
case 'permission':
if (!empty($data['permission_group_id']) && !empty($data['permission_id'])) {
$url .= '/' . $data['permission_group_id'] . '/' . $data['permission_id'];
}
break;
case 'permission-group':
if (!empty($data['permission_group_id'])) {
$url .= '/' . $data['permission_group_id'];
}
break;
case 'interface-group':
if (!empty($data['interface_group_id'])) {
$url .= '/' . $data['interface_group_id'];
}
break;
}
if (isset($actionParts[1])) {
$url .= '/' . $actionParts[1];
}
return $url . $extension;
}
return false;
}
示例2: buildLink
/**
* Method to build a link to the specified page/action with the provided
* data and params.
*
* @see XenForo_Route_BuilderInterface
*/
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if (is_array($data) && isset($data['original_prefix'], $data['route_type'])) {
XenForo_Link::prepareExtensionAndAction($extension, $action);
return "{$outputPrefix}/{$data['route_type']}/{$data['original_prefix']}/{$action}{$extension}";
} else {
return false;
}
}
示例3: buildLink
/**
* Method to build a link to the specified page/action with the provided
* data and params.
*
* @see XenForo_Route_BuilderInterface
*/
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if (is_array($data)) {
XenForo_Link::prepareExtensionAndAction($extension, $action);
if (strpos($action, '-option') !== false) {
if (isset($data['option_id'])) {
return "{$outputPrefix}/{$action}/{$data['option_id']}{$extension}";
}
} else {
if (isset($data['group_id'])) {
return "{$outputPrefix}/{$action}/{$data['group_id']}{$extension}";
}
}
}
return false;
}