---
title: "String Übergabe an Controller"
url: "https://www.typo3.net/d/106360-string-uebergabe-an-controller"
source: "typo3.net"
tags: ["Extensions","Extbase","Frage"]
created: "2011-07-18"
last_reply: "2011-07-20"
replies: 3
solved: false
page: 1
pages: 1
lang: "de"
---

# String Übergabe an Controller

Extensions › Extbase · 3 Antworten · gestartet 2011-07-18

## Eröffnungsbeitrag

**oliver.​christ** · 2011-07-18 · [Beitrag #1](https://www.typo3.net/d/106360-string-uebergabe-an-controller/1)

Hallo,
ich versuche in Extbase einen String zusätzlich zu einem Objekt an den Controller zu übergeben, was mir nicht gelingen will.

Der Controller wird über folgenden Link aufgerufen:

```html
<f:link.action action="compare" arguments="{typo3Instance:typo3Instance,table:table1}">compare</f:link.action>
```

Der Link wird auch korrekt erzeugt:

<http://typo3-45.localhost/typo3/mod.php?M=tools_SynchronisationSynchronisation&tx_synchronisation_tools_synchronisationsynchronisation%5Btypo3Instance%5D=3&tx_synchronisation_tools_synchronisationsynchronisation%5Btable%5D=be_users&tx_synchronisation_tools_synchronisationsynchronisation%5Baction%5D=compare&tx_synchronisation_tools_synchronisationsynchronisation%5Bcontroller%5D=Typo3Instance>

So schaut dann meine function im Controller aus:

```php
/**
* Compares a table of a typo3 instance with an other instance
*
* @param string $table the Typo3Instance table to compare
* @param Tx_Synchronisation_Domain_Model_Typo3Instance $typo3Instance the Typo3Instance to display
* @return string The rendered view
*/
public function compareAction(Tx_Synchronisation_Domain_Model_Typo3Instance $typo3Instance, $table) {
  $this->view->assign('table', $table);
  $this->view->assign('typo3Instance', $typo3Instance);
}
```

Im aufgerufenen Template mache ich dann eine Ausgabe mit:

```html
<f:debug>{table}</f:debug>
```

welche immer leer ist.
Mir scheint eine große Sache kann das nicht sein, aber ich komme nicht drauf. Ich bin für jeden Hinweis dankbar und hoffe das Thema kam nicht schon tausendmal vor in dem Forum.

Gruß Olli

## Antworten

### [#2](https://www.typo3.net/d/106360-string-uebergabe-an-controller/2) · aimcom · 2011-07-18

Du kannst auf Argumente in der URL so zugreifen:

```php
$this->request->getArgument('table');
```

Falls es den Parameter nicht gibt, wird jedoch eine Exception ausgelöst. Das kannst du mittels try/catch abfangen oder du frägst mit *hasArgument('table')* ab, ob es das Argument überhaupt gibt.

### [#3](https://www.typo3.net/d/106360-string-uebergabe-an-controller/3) · oliver.​christ · 2011-07-18

klappt... vielen Dank für die schnelle Hilfe.

Gruß Olli

### [#4](https://www.typo3.net/d/106360-string-uebergabe-an-controller/4) · oliver_g · 2011-07-20

Ich habe das auch noch nicht ganz gecheckt mit den arguments.

Manchmal sind diese da, manchmal aber auch nicht. Ich geh dann auch auf Nummer sicher und hole mir diese über $this->getArguments().

Gruß

---

Quelle: „String Übergabe an Controller“, typo3.net, https://www.typo3.net/d/106360-string-uebergabe-an-controller
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
