[TYPO3-english] what is the best way to get parameters from URL

Jigal van Hemert jigal.van.hemert at typo3.org
Wed Mar 9 08:28:12 CET 2016


Hi,

On 08/03/2016 13:44, dilip mdl wrote:
> I am new on typo3 7 and getting issue on getting GET parameters from URL
> while navigating from different pages. The URL pattern changes as per
> the page.
>
> For example:
> http://localhost/typo3_abs/38/?tx_wxproducts_productdetail[pcuid]=1&tx_wxproducts_productdetail[controller]=WxProducts&cHash=97a8309a492ceb63ef281f440c1482f3
>
>
> http://localhost/typo3_abs/38/?tx_wxproducts_allcategory[pcuid]=1&tx_wxproducts_allcategory[controller]=WxCategory&cHash=59476e67fa0a2347e94fdbfa95847776
>
>
> You can see tx_wxproducts_productdetail and tx_wxproducts_allcategory in
> URL for same page while navigating from two different page.

Can you explain a bit from which context you are trying to get these 
parameters? From TypoScript it will be different than from JavaScript, 
an extbase controller, etc.

In general, from PHP code inside a TYPO3 extension you can always call
\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tx_wxproducts_productdetail') 
and get an array with all the parameter from that prefix:

array (
  'pcuid' => 1,
  'controller' => 'WxProducts'
)

In TypoScript you can use

foo.data = GP:tx_wxproducts_productdetail|pcuid

to get the pcuid value from the first url.

-- 
Jigal van Hemert
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-english mailing list