Benutzer:Samson1964/URL's generieren: Unterschied zwischen den Versionen

Aus Contao Community Documentation

(Die Seite wurde neu angelegt: „Für eigene Erweiterungen stellt der Core folgende Funktionen zur Verfügung: = Funktion addToUrl = Als aktuelle Seite wird in allen Beispielen eine Seite mi…“)
 
(Funktion addToUrl)
 
Zeile 11: Zeile 11:
 
</source>
 
</source>
  
Vor Contao 3.2.8 war das Ergebnis: '''test.html?foo=bar'''
+
Vor Contao 3.2.8 war das Ergebnis: '''test.html?foo=bar'''<br>
Seit Contao 3.2.8 ist das Ergebnis: '''test/foo/bar.html'''
+
Seit Contao 3.2.8 ist das Ergebnis: '''test/foo/bar.html'''<br>
Siehe dazu auch [https://github.com/contao/core/issues/6736].
+
Siehe dazu auch [https://github.com/contao/core/issues/6736 github.com/contao/core/issues/6736].
 +
 
 +
Die bessere Schreibweise ab Contao 3.5 ist
 +
 
 +
<source lang="php">
 +
\Frontend::addToUrl('foo=bar');
 +
</source>

Aktuelle Version vom 18. August 2018, 20:39 Uhr

Für eigene Erweiterungen stellt der Core folgende Funktionen zur Verfügung:

Funktion addToUrl

Als aktuelle Seite wird in allen Beispielen eine Seite mit dem Alias test angenommen.

Variante 1

$this->addToUrl('foo=bar');

Vor Contao 3.2.8 war das Ergebnis: test.html?foo=bar
Seit Contao 3.2.8 ist das Ergebnis: test/foo/bar.html
Siehe dazu auch github.com/contao/core/issues/6736.

Die bessere Schreibweise ab Contao 3.5 ist

\Frontend::addToUrl('foo=bar');
Ansichten
Meine Werkzeuge

Contao Community Documentation

Pelle: gibt's ein besseres Wort für "beschränkt"?
Thomas: "Kunde"

Navigation
Verstehen
Verwenden
Entwickeln
Verschiedenes
Werkzeuge