本文整理汇总了PHP中XenForo_Router::resolveActionWithStringParam方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Router::resolveActionWithStringParam方法的具体用法?PHP XenForo_Router::resolveActionWithStringParam怎么用?PHP XenForo_Router::resolveActionWithStringParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Router
的用法示例。
在下文中一共展示了XenForo_Router::resolveActionWithStringParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: match
/**
*
* @see XenForo_Route_PrefixAdmin_AddOns::match()
*/
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$parts = explode('/', $routePath, 3);
switch ($parts[0]) {
case 'languages':
$parts = array_slice($parts, 1);
$routePath = implode('/', $parts);
$action = $router->resolveActionWithIntegerParam($routePath, $request, 'language_id');
return $router->getRouteMatch('XenForo_ControllerAdmin_Language', $action, 'languages');
case 'phrases':
$parts = array_slice($parts, 1);
$routePath = implode('/', $parts);
return $router->getRouteMatch('XenForo_ControllerAdmin_Phrase', $routePath, 'phrases');
}
if (count($parts) > 1) {
switch ($parts[1]) {
case 'languages':
$action = $router->resolveActionWithStringParam($routePath, $request, 'addon_id');
$parts = array_slice($parts, 2);
$routePath = implode('/', $parts);
$action = $router->resolveActionWithIntegerParam($routePath, $request, 'language_id');
return $router->getRouteMatch('XenForo_ControllerAdmin_Language', $action, 'languages');
case 'phrases':
$action = $router->resolveActionWithStringParam($routePath, $request, 'addon_id');
$parts = array_slice($parts, 2);
$routePath = implode('/', $parts);
return $router->getRouteMatch('XenForo_ControllerAdmin_Phrase', $routePath, 'phrases');
}
}
return parent::match($routePath, $request, $router);
}
示例2: match
/**
* Match a specific route for an already matched prefix.
*
* @see XenForo_Route_Interface::match()
*/
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$controller = 'QCPlayers_ControllerPublic_Player';
$routePath .= '/';
$action = $router->resolveActionWithStringParam($routePath, $request, 'username');
return $router->getRouteMatch($controller, $action, 'players', $routePath);
}
示例3: match
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$components = explode('/', $routePath);
$subPrefix = strtolower(array_shift($components));
$strParams = '';
$slice = false;
switch ($subPrefix) {
case 'options':
$controllerName = '_Options';
$strParams = 'option_id';
$slice = true;
break;
case 'layouts':
$controllerName = '_Layouts';
$strParams = 'layout_id';
$slice = true;
break;
case 'blocks':
$controllerName = '_Blocks';
$strParams = 'block_id';
$slice = true;
break;
case 'categories':
$controllerName = '_Categories';
$strParams = 'category_slug';
$slice = true;
break;
default:
$controllerName = '_Blocks';
}
$routePathAction = $slice ? implode('/', array_slice($components, 0, 2)) : $routePath;
$action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams);
return $router->getRouteMatch('EWRporta_ControllerAdmin' . $controllerName, $action, 'EWRporta', $routePath);
}
示例4: match
/**
* Match a specific route for an already matched prefix.
*
* @see XenForo_Route_Interface::match()
*/
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$components = explode('/', $routePath);
if (isset($components[1]) && preg_match('#^([0-9]*)$#', $components[1], $matches)) {
$request->setParam('chapter', $components[1]);
$request->setParam('url_portion', $components[0]);
unset($components[0], $components[1]);
$action = implode('', $components);
} elseif (isset($components[1]) && preg_match('#^([0-9]*):([0-9]*)$#', $components[1], $matches)) {
$request->setParam('chapter', $matches[1]);
$request->setParam('verse', $matches[2]);
$request->setParam('url_portion', $components[0]);
unset($components[0], $components[1]);
$action = implode('', $components);
} elseif (isset($components[1]) && preg_match('#^([0-9]*):([0-9]*)-([0-9]*)$#', $components[1], $matches)) {
$request->setParam('chapter', $matches[1]);
$request->setParam('verse', $matches[2]);
$request->setParam('verse_to', $matches[3]);
$request->setParam('url_portion', $components[0]);
unset($components[0], $components[1]);
$action = implode('', $components);
} else {
$action = $router->resolveActionWithStringParam($routePath, $request, 'url_portion');
}
return $router->getRouteMatch('ThemeHouse_Bible_ControllerPublic_Bible', $action, 'bible');
}
示例5: match
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$components = explode('/', $routePath);
$subPrefix = strtolower(array_shift($components));
$controllerName = '';
$action = '';
$intParams = 'page_id';
$strParams = '';
$slice = false;
switch ($subPrefix) {
case 'special':
if (!empty($components[1]) && ($components[0] == 'edit-template' || $components[0] == 'delete-template')) {
unset($components[1]);
}
$controllerName = '_Special';
$slice = true;
break;
case 'archive':
$controllerName = '_Archive';
$intParams = 'history_id';
$slice = true;
break;
default:
$strParams = 'page_slug';
}
$routePathAction = implode('/', array_slice($slice ? $components : explode('/', $routePath), 0, 2)) . '/';
$routePathAction = str_replace('//', '/', $routePathAction);
if ($strParams) {
$action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams);
} else {
$action = $router->resolveActionWithIntegerParam($routePathAction, $request, $intParams);
}
$action = $router->resolveActionAsPageNumber($action, $request);
return $router->getRouteMatch('EWRcarta_ControllerPublic_Wiki' . $controllerName, $action, 'wiki', $routePath);
}
示例6: match
/**
* Handles routing for view page.
**/
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
// Many thanks to Jaxel for his documentation on this (http://xenforo.com/community/threads/13605/)
$components = explode('/', $routePath);
$subPrefix = strtolower(array_shift($components));
$subSplits = explode('.', $subPrefix);
$slice = false;
switch ($subPrefix) {
case 'confirm':
$controller = "Confirm";
break;
case 'delete':
$controller = "Delete";
break;
case 'api':
$controller = "Api";
break;
case 'view':
default:
$controller = 'View';
}
$routePathAction = ($slice ? implode('/', array_slice($components, 0, 2)) : $routePath) . '/';
$routePathAction = str_replace('//', '/', $routePathAction);
$action = $router->resolveActionWithStringParam($routePathAction, $request, "string_id");
return $router->getRouteMatch('AssociationMc_ControllerPublic_' . $controller, $action, 'view');
}
示例7: match
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
if (in_array($routePath, array('add', 'save'))) {
$action = $routePath;
} else {
$action = $router->resolveActionWithStringParam($routePath, $request, 'client_id');
}
return $router->getRouteMatch('bdApi_ControllerAdmin_Client', $action, 'bdApi');
}
示例8: match
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
if (in_array($routePath, array('', 'index'))) {
$action = $routePath;
} else {
$action = $router->resolveActionWithStringParam($routePath, $request, Tinhte_XenTag_Constants::URI_PARAM_TAG_TEXT);
if (preg_match('/^page-(\\d+)$/', $action, $matches)) {
// supports matching /tags/text/page-n links
$request->setParam('page', $matches[1]);
$action = 'view';
}
}
return $router->getRouteMatch('Tinhte_XenTag_ControllerPublic_Tag', $action, Tinhte_XenTag_Option::get('majorSection'));
}
示例9: match
/**
* Match a specific route for an already matched prefix.
*
* @see XenForo_Route_Interface::match()
*/
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$xenOptions = XenForo_Application::get('options');
if ($xenOptions->th_models_enableAddOnChooser) {
$action = $router->resolveActionWithStringParam($routePath, $request, 'addon_id');
if ($request->getParam('addon_id') == 'data-writers') {
$action = 'data-writers' . $action;
$request->setParam('addon_id', '');
}
if (strlen($action) >= strlen('data-writers') && substr($action, 0, strlen('data-writers')) == 'data-writers') {
return $router->getRouteMatch('ThemeHouse_DataWriters_ControllerAdmin_DataWriter', substr($action, strlen('data-writers')), 'dataWriters');
}
}
return parent::match($routePath, $request, $router);
}
示例10: match
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$components = explode('/', $routePath);
$subPrefix = strtolower(array_shift($components));
$subSplits = explode('.', $subPrefix);
$controllerName = '';
$action = '';
$intParams = 'event_id';
$strParams = '';
$slice = false;
switch ($subPrefix) {
case 'monthly':
$controllerName = '_Monthly';
$strParams = 'date_select';
$slice = true;
break;
case 'weekly':
$controllerName = '_Weekly';
$strParams = 'date_select';
$slice = true;
break;
case 'daily':
$controllerName = '_Daily';
$strParams = 'date_select';
$slice = true;
break;
case 'birthdays':
$controllerName = '_Birthdays';
$strParams = 'date_select';
$slice = true;
break;
default:
if (is_numeric(end($subSplits))) {
$controllerName = '_Event';
}
}
$routePathAction = ($slice ? implode('/', array_slice($components, 0, 2)) : $routePath) . '/';
$routePathAction = str_replace('//', '/', $routePathAction);
$routePathAction = preg_replace('#create/\\d+#i', 'create/', $routePathAction);
if ($strParams) {
$action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams);
} elseif ($intParams) {
$action = $router->resolveActionWithIntegerParam($routePathAction, $request, $intParams);
}
$action = $router->resolveActionAsPageNumber($action, $request);
return $router->getRouteMatch('EWRatendo_ControllerPublic_Events' . $controllerName, $action, 'events', $routePath);
}
示例11: match
/**
* Match a specific route for an already matched prefix.
*
* @see XenForo_Route_Interface::match()
*/
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$controller = '';
$action = $router->resolveActionWithStringParam($routePath, $request, 'game_title');
$action = $router->resolveActionWithIntegerParam($routePath, $request, 'game_id');
$actions = array_filter(explode('/', $action));
switch (count($actions)) {
case 4:
$controller = '_Field';
$request->setParam('profile_id', intval($actions[1]));
$request->setParam('field_id', intval($actions[3]));
$action = 'index';
break;
case 3:
$controller = '_Field';
$request->setParam('profile_id', intval($actions[1]));
$action = 'index';
break;
case 2:
if ($actions[0] == 'profiles') {
$controller = '_Profile';
$request->setParam('profile_id', intval($actions[1]));
}
if ($actions[0] == 'users') {
$controller = '_User';
$request->setParam('user_id', intval($actions[1]));
}
$action = 'edit';
break;
case 1:
if ($actions[0] == 'profiles') {
$controller = '_Profile';
$action = 'index';
} else {
if ($actions[0] == 'users') {
$controller = '_User';
$action = 'index';
}
}
break;
default:
$action = 'index';
}
return $router->getRouteMatch('autocraft_ControllerAdmin_Game' . $controller, $action, 'autocraft');
}
示例12: match
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$controllerName = '';
$components = explode('/', $routePath);
$subPrefix = strtolower(array_shift($components));
$strParams = '';
$slice = false;
// Add additional portal widgets controllers here
switch ($subPrefix) {
case 'carousel':
$controllerName = $controllerName . 'Carousel';
$strParams = 'widget_id';
$slice = true;
break;
default:
$controllerName = 'Portal';
$strParams = 'slug';
}
$routePathAction = $slice ? implode('/', array_slice($components, 0, 2)) : $routePath;
$action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams);
return $router->getRouteMatch('WidgetPortal_ControllerPublic_Widget_' . $controllerName, $action, 'BuzzTags', $routePath);
}
示例13: match
/**
* Match a specific route for an already matched prefix.
*
* @see XenForo_Route_Interface::match()
*/
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$action = $router->resolveActionWithStringParam($routePath, $request, 'addon_id');
return $router->getRouteMatch('XenForo_ControllerAdmin_AddOn', $action, 'addOns');
}
示例14: match
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$action = $router->resolveActionWithStringParam($routePath, $request, 'hook_id');
return $router->getRouteMatch('Turki_Adv_ControllerAdmin_Hooks', $action, 'adfxf-hook');
}
示例15: match
/**
* Match a specific route for an already matched prefix.
*
* @see XenForo_Route_Interface::match()
*/
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$GLOBALS['ThemeHouse_DataWriters_Route_PrefixAdmin_DataWriters'] = $this;
$action = $router->resolveActionWithStringParam($routePath, $request, 'class');
return $router->getRouteMatch('ThemeHouse_DataWriters_ControllerAdmin_DataWriter', $action, 'dataWriters');
}