$url = $modx->makeUrl(25, '', array('hello' => 'world'));$url = $modx->makeUrl(25, '', 'hello=world');
$url = $modx->makeUrl(25, '', array('hello' => 'world', 'foo' => 'bar'));$url = $modx->makeUrl(25, '', array('hello' => $world, 'foo' => $bar));$url = $modx->makeUrl(25, '', 'hello='.$world);
$url = $modx->makeUrl(25, '', 'hello={$world}');$modx->sendRedirect($url);
This question has been answered by cleanboy. See the first response.
$url = $modx->makeUrl(25, '', array('hello' => 'world', 'foo' => 'bar'));$world = 'world';
$bar = 'bar';
$url = $modx->makeUrl(25, '', array('hello' => $world, 'foo' => $bar));$title = $modx->runSnippet('getCarVars', array('get'=>'pagetitle'));
$price = $modx->runSnippet('getCarVars', array('get'=>'price'));
$img = $modx->runSnippet('getCarVars', array('get'=>'img'));$output = "";
switch($get){
case "pagetitle":
$output .= $_GET['pagetitle'];
break;
case "price":
$output .= $_GET['price'];
break;
case "img":
$output .= $_GET['carimage'];
break;
}
return $output;$url = $modx->makeUrl(17,'',array('pagetitle' => $title, 'price' => $price, 'carimage' => $img));/** * getReqParam * * Copyright 2010 by Shaun McCormick <[email protected]> * * getReqParam is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * getReqParam is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * getReqParam; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * * @package getreqparam */ /** * Returns a parameter from the php request object or other globals. * * @author Shaun McCormick <[email protected]> * @license GPLv2 * @param string $name The name of the variable. * @param string $type The type of request. Defaults to GET. * @package getreqparam * * Works with Revolution 2.0.0. */ if (empty($modx) || empty($scriptProperties['name']) || empty($scriptProperties['type'])) return null; $name = $scriptProperties['name']; $type = !empty($scriptProperties['type']) ? $scriptProperties['type'] : 'GET'; switch ($type) { case 'SERVER': return isset($_SERVER[$name]) ? $_SERVER[$name] : null; break; case 'POST': return isset($_POST[$name]) ? $_POST[$name] : null; break; case 'FILES': return isset($_FILES[$name]) ? $_FILES[$name] : null; break; case 'COOKIE': return isset($_COOKIE[$name]) ? $_COOKIE[$name] : null; break; case 'SESSION': return isset($_SESSION[$name]) ? $_SESSION[$name] : null; break; case 'REQUEST': return isset($_REQUEST[$name]) ? $_REQUEST[$name] : null; break; case 'GET': default: return isset($_GET[$name]) ? $_GET[$name] : null; break; } return null;
$title = $modx->runSnippet('getReqParam', array('name'=>'pagetitle'));
$price = $modx->runSnippet('getReqParam', array('name'=>'price'));
$img = $modx->runSnippet('getReqParam', array('name'=>'img'));$title = $modx->getOption('pagetitle',$_REQUEST,'');
$price = $modx->getOption('price',$_REQUEST,'');
$img = $modx->getOption('img',$_REQUEST,''); $carId = $modx->runSnippet('getReqParam', array('name'=>'id'));
$carResource = $modx->getObject('modResource', $carId);
$title = $carResource->get('pagetitle');
$price = $carResource->getTVValue('price');
$img = $carResource->getTVValue('home-img');
$url = $modx->makeUrl(17,'',array('pagetitle' => $title, 'price' => $price, 'carimage' => $img));$url = $modx->makeUrl(17,'web',array('pagetitle' => $title, 'price' => $price, 'carimage' => $img), 'full');