|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Mon Aug 30, 2004 2:25 pm Post subject: Array indizes dynamisch ansprechen |
|
|
Hallo zusammen,
könnte solch ein Templategeflecht funktionieren?
Hab grad keine Smarty umgebung hier um die Idee zu testen.
form.tpl:
Code: |
{ include file="news_header.tpl"}
{ if isset( $smarty.get.id_news)) }
{ foreach from=$aNewsParagraphs item="aParagraph" key="index"}
{ include file="news_body.tpl" index="{$index}"}
{ /foreach }
{ /if }
|
news_header.tpl:
Code: |
<form action="{ $smarty.server.php_self }" method="post">
<select name="id_newscat">
{ html_options options=$aNewsCats }
</select>
{ validate field="title" criteria="notEmpty" append="aErrors" message="Der Titel des Artikels fehlt!" }
<input type="text" name="title" value="{ $title }"/>
{ validate field="intro" criteria="notEmpty" append="aErrors" message="Das Intro des Artikels fehlt!" }
<textarea name="intro">{ $intro }</textarea>
</form>
|
news_body.tpl:
Code: |
<form action="{ $smarty.server.php_self }" method="post">
{ validate field="title" criteria="notEmpty" append="aErrors" message="Der Titel des { $index }. Absatzes fehlt!" }
<input type="text" name="title" value="{ $aNewsParagraphs[$index].title }"/>
{ validate field="intro" criteria="notEmpty" append="aErrors" message="Der Text des { $index }. Absatzes fehlt!" }
<textarea name="intro">{ $aNewsParagraphs[$index].intro }</textarea>
</form>
|
|
|
Back to top |
|
|
|
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
|