[TYPO3-dev] Multidimensional URL-Parameters
Bernhard Kraft
kraftb at think-open.at
Mon Aug 23 13:49:01 CEST 2010
Am 2010-08-20 13:15, schrieb David Bruchmann:
> If you know about an extension or have programmed one with those
> requirements I'd like to know how the URL-parts are structured and
> perhaps how building and interpreting is realized.
> Technically I'm interested in solutions for pi_base (cms), MVC (extbase)
> and other frameworks.
In the most cases when I need to generate an URL/link I use the
$this->cObj->typoLink(...) method. The typoLink method is the method of
class.tslib_content.php which also gets used to generate every link
found inside an RTE or any link you set via the "Link" fields for
headlines, images, etc.
This "typoLink" function is very powerful. You can configure it from
within TypoScript, and only set the appropriate parameters from within
your extension. It is almost impossible to formulate everything you can
do with it. Here just an example.
Create a TypoScript:
plugin.tx_myext_pi1.myLink {
parameter = 123
additionalParams.dataWrap =
&tx_myext[cobj_1][page]={GP:tx_myext|cobj_1|page}&tx_myext[cobj_2][page]={register:browserPage}
returnLast = url
useCacheHash = 1
}
This configuration links to page 123 with the parameters set in
"additionalParams". One of the browser-parameters is taken from the GET
vars and the other one from a register.
In your extension/php code you can then gerate a link by using:
$link = $this->cObj->typoLink('', $this->conf['myLink.']);
Of course you can do a lot more with the "->typoLink" function/method.
Just look up the features in the TSref:
http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.3.2/view/1/5/#id2507605
greetings,
Bernhard
More information about the TYPO3-dev
mailing list