[TYPO3-mvc] POST/GET vars

Bastian Waidelich bastian at typo3.org
Tue Oct 19 12:13:10 CEST 2010


Dawid Pacholczyk wrote:

Hi Dawid,

>> May I ask why you need to access global GET/POST vars?

> cause I want to make an extension that works on single view of another
> extension.

I see. In that case you might want to try using the configurable plugin 
namespace that we introduced with three weeks ago [1].

E.g. if you want to access tt_news parameters in your plugin, you could add
plugin.tx_yourext_plugin.view.pluginNamespace = tx_ttnews
(or "plugin.tx_yourext.view.pluginNamespace = tx_ttnews" if you want to 
change it for all plugins of the extension)
to your TypoScript configuration in setup.txt.

Then all tt_news parameters will be available in your plugin and you 
could e.g. have an action like this:

/**
  * @param integer $tt_news news article uid
  * @return void
  */
public function indexAction($tt_news) {
	debug($tt_news, 'current tt_news uid');
}

If you'd insert that plugin on your tt_news details page you should have 
the tt_news article uid available in $tt_news.

BTW: If you have a domain model for tt_news records, you could even make 
use of the "PropertyMapper" that converts the uid to an object 
transparently:

/**
  * @param Tx_YourExt_Domain_Model_Article $tt_news The tt_news article
  * @return void
  */
public function indexAction(Tx_YourExt_Domain_Model_Article $tt_news) {
	debug($tt_news->getTitle(), 'current tt_news title');
}


HTH,
Bastian



[1] http://forge.typo3.org/projects/typo3v4-mvc/repository/revisions/2588


More information about the TYPO3-project-typo3v4mvc mailing list