Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Kommentare in Array-Strukturen

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
JensD
Smarty n00b


Joined: 31 Oct 2016
Posts: 2

PostPosted: Wed Nov 02, 2016 7:12 am    Post subject: Kommentare in Array-Strukturen Reply with quote

Hallo,

wir verwenden größere mehrdimensionale Array-Strukturen in Smarty, welche Konfigurationen u.ä. enthalten die dann z.B. in JSON überführt werden oder mit denen dann in der Webseite gearbeiten wird.
Hier würde es sich anbieten einzelne Zeile in solch einem Konfigurations-Array zu kommentieren. Leider finden wir keine Möglichkeit dies zu tun.

z.B. verursacht folgender Code einen Fehler
Code:

{$array = [
   value1 => 'foo',   {* The first value, can be 'foo' or 'john' *}
   value2 => 'bar'    {* The second value, can be 'bar' or 'doe' *}
]}


Gibt es hier aktuell schon eine Möglichkeit die ich übersehe habe, oder ließe sich Smarty diesbezüglich einfach erweitern?

Die Forums-Suche gibt dazu leider nichts her, ich kann mir aber auch nicht vorstellen, dass wir die einzigen sind, die diesen Anwendungsfall für Kommentare haben.

Viele Grüße,
Jens
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1532

PostPosted: Wed Nov 02, 2016 12:08 pm    Post subject: Reply with quote

Smarty is a template engine, not a programming language.
This kind of things should be located in your code, or if you absolutely want documentation in your template, entire block should be a comment explaining the structure of the data passed to the template.

IMHO: Do not use assignment in the template without a very good reason.
Back to top
View user's profile Send private message
JensD
Smarty n00b


Joined: 31 Oct 2016
Posts: 2

PostPosted: Wed Nov 02, 2016 1:55 pm    Post subject: Reply with quote

Hello,

we are using Smarty as layer above PHP, which restricts the available functionality, since our customers are allowed to modify their website, without to get direct access to the database or other "critical" PHP functionality.

Our frontend developers and our customers don't have access to the PHP code, they are working only in Smarty, which works very well since years.
Since the Smarty code is compiled into PHP, I also don't see a benefit of doing it directly in PHP.

The only request we get from the frontend team very often is, to be able add comments into array structures.

Many regards,
Jens
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP