本文整理汇总了PHP中Zend_Controller_Request_Http::setParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Request_Http::setParam方法的具体用法?PHP Zend_Controller_Request_Http::setParam怎么用?PHP Zend_Controller_Request_Http::setParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Request_Http
的用法示例。
在下文中一共展示了Zend_Controller_Request_Http::setParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: match
public function match(Zend_Controller_Request_Http $request)
{
if (!Mage::isInstalled()) {
Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
exit;
}
$pathInfo = trim($request->getPathInfo(), '/');
$params = explode('/', $pathInfo);
if (isset($params[0]) && $params[0] == 'miembro' || isset($params[0]) && $params[0] == 'member') {
//redirect to mymodule/brands/index/brand_name/addidas
$request->setModuleName('member')->setControllerName('index')->setActionName('index');
if (isset($params[1])) {
$request->setParam('member_url', $params[1]);
}
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $pathInfo);
return true;
}
if (isset($params[0]) && $params[0] == 'mwcon') {
$request->setModuleName('member')->setControllerName('index')->setActionName('signin');
if (isset($params[1])) {
$request->setParam('member_id', $params[1]);
}
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $pathInfo);
return true;
}
return false;
}
示例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)
{
$components = explode('/', $routePath);
$action = strtolower(array_shift($components));
if (count($components) == 1) {
// permission/<action>, etc
$action .= reset($components);
} else {
switch ($action) {
case 'permission':
// permission/<group>/<permission>/<action>
$request->setParam('permission_group_id', array_shift($components));
$request->setParam('permission_id', array_shift($components));
break;
case 'permission-group':
// permission-group/<group>/<action>
$request->setParam('permission_group_id', array_shift($components));
break;
case 'interface-group':
// interface-group/<group>/<action>
$request->setParam('interface_group_id', array_shift($components));
break;
}
$action .= implode('', $components);
}
return $router->getRouteMatch('XenForo_ControllerAdmin_Permission', $action, 'permissionsDevelopment');
}
示例3: 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');
}
示例4: match
/**
* Match the request
*
* @param Zend_Controller_Request_Http $request
* @return boolean
*/
public function match(Zend_Controller_Request_Http $request)
{
//checking before even try to find out that current module
//should use this router
if (!$this->_beforeModuleMatch()) {
return false;
}
$front = $this->getFront();
$path = trim($request->getPathInfo(), '/');
$p = explode('/', $path);
if (count($p) == 0 || !$this->_pluarizeName($p[0])) {
return false;
} else {
$module = $this->_pluarizeName($p[0]);
$modules = $this->getModuleByFrontName($module);
if ($modules === false) {
return false;
}
// checks after we found out that this router should be used for current module
if (!$this->_afterModuleMatch()) {
return false;
}
// set values only after all the checks are done
$request->setModuleName($module);
$request->setControllerName('index');
$action = $this->_getActionFromPathInfo($p);
$request->setActionName($action);
$realModule = 'Zefir_Dealers';
$request->setControllerModule($realModule);
$request->setRouteName('dealers');
// dispatch action
$request->setDispatched(true);
/**
* Set params for the request
*/
if ($action == 'view') {
$request->setParam('dealer_code', $p[1]);
} else {
// set parameters from pathinfo
for ($i = 3, $l = sizeof($p); $i < $l; $i += 2) {
$request->setParam($p[$i], isset($p[$i + 1]) ? urldecode($p[$i + 1]) : '');
}
}
// instantiate controller class and dispatch action
$controllerClassName = $this->_validateControllerClassName($realModule, 'index');
$controllerInstance = Mage::getControllerInstance($controllerClassName, $request, $front->getResponse());
$controllerInstance->dispatch($action);
return true;
}
}
示例5: init
/**
* Init method.
* Call during construction of the controller to perform some default initialization.
*/
public function init()
{
parent::init();
$this->getResponse()->setHeader('Content-Type', $this->_mimetype);
$this->_request->setParam('view', $this->_helper->viewRenderer);
$this->_helper->viewRenderer->setViewScriptPathSpec(":action.phtml");
$this->view->addHelperPath(USVN_HELPERS_DIR, 'USVN_View_Helper');
$this->_helper->layout->setLayout('default');
$this->_request->setParam('project', $this->_request->getParam('project', '__NONE__'));
$this->_request->setParam('area', $this->_request->getParam('area', '__NONE__'));
if ($this->_mimetype != 'text/html') {
$this->_helper->viewRenderer->setNoRender();
}
}
示例6: 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)
{
if (strpos($routePath, '/') !== false) {
list($action, $value) = explode('/', $routePath);
if (strpos($action, '-option') !== false) {
$request->setParam('option_id', $value);
} else {
$request->setParam('group_id', $value);
}
} else {
$action = $routePath;
}
return $router->getRouteMatch('XenForo_ControllerAdmin_Option', $action, 'optionsLink');
}
示例7: testYearAlnumSelected
function testYearAlnumSelected()
{
$vehicle = $this->createMMY('Honda', 'Civic', '2000');
$request = new Zend_Controller_Request_Http();
$request->setParam('make', $vehicle->getLevel('make')->getTitle());
$request->setParam('model', $vehicle->getLevel('model')->getTitle());
$request->setParam('year', $vehicle->getLevel('year')->getTitle());
$search = new VF_Search_Form();
VF_Singleton::getInstance()->setRequest($request);
$searchlevel = new VF_Search_Level();
$searchlevel->display($search, 'year');
$entity = $vehicle->getLevel('year');
$this->assertTrue($searchlevel->isLevelSelected($entity));
}
示例8: 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);
$componentCount = count($components);
if ($componentCount >= 3) {
$request->setParam('route_type', array_shift($components));
$request->setParam('original_prefix', array_shift($components));
} else {
if ($componentCount == 2) {
$request->setParam('route_type', array_shift($components));
}
}
$action = implode('', $components);
return $router->getRouteMatch('XenForo_ControllerAdmin_RoutePrefix', $action, 'routePrefixes');
}
示例9: match
public function match(Zend_Controller_Request_Http $request)
{
if (!Mage::isInstalled()) {
Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
exit;
}
$identifier = trim($request->getPathInfo(), '/');
/* @var $parser Hackathon_Layeredlanding_Model_Layeredlanding */
$landingPage = Mage::getModel('layeredlanding/layeredlanding')->loadByUrl($identifier);
if (!$landingPage->getId()) {
return false;
}
Mage::register('current_landingpage', $landingPage);
Mage::app()->getStore()->setConfig(Mage_Catalog_Helper_Category::XML_PATH_USE_CATEGORY_CANONICAL_TAG, 0);
// disable canonical tag
// if successfully gained url parameters, use them and dispatch ActionController action
$categoryIdsValue = $landingPage->getCategoryIds();
$categoryIds = explode(',', $categoryIdsValue);
$firstCategoryId = $categoryIds[0];
$request->setRouteName('catalog')->setModuleName('catalog')->setControllerName('category')->setActionName('view')->setParam('id', $firstCategoryId);
/** @var $attribute Hackathon_Layeredlanding_Model_Attributes */
foreach ($landingPage->getAttributes() as $attribute) {
$attr = Mage::getModel('eav/entity_attribute')->load($attribute->getAttributeId());
$request->setParam($attr->getAttributeCode(), $attribute->getValue());
}
$controllerClassName = $this->_validateControllerClassName('Mage_Catalog', 'category');
$controllerInstance = Mage::getControllerInstance($controllerClassName, $request, $this->getFront()->getResponse());
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
// dispatch action
$request->setDispatched(true);
$controllerInstance->dispatch('view');
return true;
}
示例10: testGetAliasedParamZF2455
public function testGetAliasedParamZF2455()
{
$this->_request->setParam('controller', 'value');
$this->_request->setAlias('var1', 'controller');
$this->assertEquals('value', $this->_request->getParam('controller'));
$this->assertEquals('value', $this->_request->getParam('var1'));
}
示例11: testSetNullParamUnsetsKey
public function testSetNullParamUnsetsKey()
{
$this->_request->setParam('foo', 'bar');
$this->assertEquals('bar', $this->_request->getParam('foo'));
$this->_request->setParam('foo', null);
$params = $this->_request->getParams();
$this->assertFalse(isset($params['foo']));
}
示例12: setParam
/**
* Set a userland parameter
*
* Uses $key to set a userland parameter. If $key is an alias, the actual
* key will be retrieved and used to set the parameter.
*
* @param mixed $key
* @param mixed $value
* @return Zend_Controller_Request_Http
*/
public function setParam($key, $value)
{
if (Zend_Registry::isRegistered('Zend_Translate')) {
if (false !== ($keySearch = array_search($this->getPrefix() . $key, Zend_Registry::get('Zend_Translate')->getMessages()))) {
$key = $keySearch;
}
}
return parent::setParam($key, $value);
}
示例13: test_getProjectSubMenu
public function test_getProjectSubMenu()
{
$http = new Zend_Controller_Request_Http();
$http->setParam('project', 'test');
$menu = new menus_browser($http, null);
$menuEntries = $menu->getProjectSubMenu();
$this->assertEquals(1, count($menuEntries));
$this->assertContains(array("title" => T_("Browser"), "link" => "project/test/browser/", "controller" => "index", "action" => ""), $menuEntries);
}
示例14: match
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$ourAction = 'tagged';
if (strpos($routePath, $ourAction . '/') === 0) {
// this is our request
$action = $ourAction;
$request->setParam('entity_id', str_replace('/', ',', trim(substr($routePath, strlen($ourAction)), '/')));
return $router->getRouteMatch('XenForo_ControllerPublic_Member', $action, 'members');
}
return parent::match($routePath, $request, $router);
}
示例15: match
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$parts = explode('/', $routePath);
if (count($parts) > 1) {
$data = array_pop($parts);
$request->setParam('data', $data);
$action = implode('/', $parts);
} else {
$action = $routePath;
}
return $router->getRouteMatch('DTUI_ControllerPublic_EntryPoint', $action, 'dtui');
}