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