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.

Smarty Template Variablen auslesen!

Empfohlene Antworten

Hallo zusammen,

ich habe folgendes Template:


<table cellspacing="0" cellpadding="0">
<tr>
<td>{ $sTitel }</td>
</tr>
<tr>
<td>{ $sText }</td>
</tr>
</table>
[/PHP]

nun möchte ich per function alle "Variablen" die in diesem Template vorhanden sind in ein template auslesen!

nicht so: - > http://smarty.php.net/manual/en/api.get.template.vars.php <-

hiermit kann man nur die variablen auslesen die schon vorher per "assign()" zugewiesen wurden!

ich möchte aber alle variablen eines templates, auch die die noch nicht zugewiesen wurden!

weiss jmd rat?

Besten Dank im vorraus

jo ich dachte`s mir fast.

kannst mir da unter die arme greifen?

Denkste das kommt so hin?


$Pattern = "/(\s)?\$([a-zA-Z0-9])+(\s)?/i";
$matchtes = preg_match( $Pattern, $Subject);
[/PHP]

Hm Arrays noch berücksichtigen:


$Pattern = "/(\\s)?\\$([a-z0-9])+((\\s)?\\[(\\s)?([a-z0-9])+(\\s)?\\])?(\\s)?/i";
$matchtes = preg_match( $Pattern, $Subject);
[/PHP]

hast du noch evtl. vorschläge/verbesserungen?

dann noch die mehr dimensionalen arrays


$Pattern = "/\\{(\\s)*\\$([a-z0-9])+((\\s)*\\[(\\s)*([a-z0-9])+(\\s)*\\])*(\\s)*\\}/i";
$matchtes = preg_match( $Pattern, $Subject);
[/PHP]

hast du noch evtl. vorschläge/verbesserungen?

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.