Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Probleme mit template

Empfohlene Antworten

Veröffentlicht

Hallo,

ich bin absoluter php-Anfänger und habe ne Frage zur Verwendung des 'IT'-Templatesystems (pear). Ich habe ein Html-Template erstellt und will dieses nun füllen. Das Codefragment aus der Html-Datei sieht so aus

<!--begin Kategorie-->

<tr>

<td nowrap>

<a href="{cat_link}">{cat}</a>

</td>

</tr>

<!--end Kategorie-->

-------------------------------------------------------------------------------------

Es folgt der Code aus dem zugehörigen php-Script

<?php

include('template.php');

$tpl = new integratedTemplate('./');

$tpl->loadTemplateFile('./templates/container.tpl.html');

$stringStart = file_get_contents("./templates/start.tpl.html");

$tpl->setVariable("content", $stringStart);

//hier lass ich aus Platzgründen was weg

foreach($arrayCat as $daten) {

$tpl->setCurrentBlock("Kategorie");

$tpl->setVariable("cat", $daten);

//$tpl->setVariable("cat_link", ???????????????);

$tpl->parseCurrentBlock();

}

$tpl->show();

?>

Anstatt mir den aktuellen Link des Arrays in eine neue Zelle der nächsten Zeile zu schreiben, erscheint am Ende mein Template so oft, wie das Array Einträge hat. Und jedes mal steht im Template nur ein Link. Woran liegt das?

Hab den Fehler jetzt gefunden. Es lag an der Groß- bzw. Kleinschreibung von BEGIN und END

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.