|
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 |
MAHMOOD Smarty n00b
Joined: 23 Jun 2013 Posts: 4
|
Posted: Sun Jun 23, 2013 12:27 pm Post subject: problem used Eval |
|
|
hello
I'm porgram the block with php code and insert the database but eval not work
Code: | <td width="17%" valign="top">{foreach name="main" from=$block item="info"}
{if not $smarty.foreach.last and $smarty.foreach.cats.iteration is div by 1}
<table class="right" border="0" width="50%" cellspacing="0" cellpadding="0">
<tr>
<td id="blockh" width="85">{$info.name_block}</td>
</tr>
<tr>
<td id="blockm" width="85">{eval var=$info.textblock }</td>
</tr>
</table>
{/if}
{/foreach} |
|
|
Back to top |
|
MAHMOOD Smarty n00b
Joined: 23 Jun 2013 Posts: 4
|
Posted: Sun Jun 23, 2013 1:22 pm Post subject: |
|
|
<?
echo"ok"
?>
not work |
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
|
Back to top |
|
MAHMOOD Smarty n00b
Joined: 23 Jun 2013 Posts: 4
|
Posted: Tue Jun 25, 2013 4:30 pm Post subject: |
|
|
no work I'm try i have php code in mysql I wan't view in the menu
but Eval not work for smarty |
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Tue Jun 25, 2013 5:42 pm Post subject: |
|
|
Ok, I don't think we are understanding each other.
Are you saying for this code:
{eval var=$info.textblock }
$info.textblock contains PHP or not? |
|
Back to top |
|
MAHMOOD Smarty n00b
Joined: 23 Jun 2013 Posts: 4
|
Posted: Wed Jun 26, 2013 10:18 am Post subject: |
|
|
the $info.textblock
for loop the query mysql data
the $info.textblock is have code html and php inside the database
is work fine view the html code only php code not work
code while for php
Code: | while ($block1 =mysql_fetch_array ($query2))
{
$block[] = $block1;
} |
loop for smarty
Code: | <td width="16%" valign="top">{foreach name="main" from=$blockl item="info"}
{if not $smarty.foreach.last and $smarty.foreach.cats.iteration is div by 1}
<table class="left" border="0" width="10%" cellspacing="0" cellpadding="0">
<tr>
<td id="blockh" width="85">{$info.name_block}</td>
</tr>
<tr>
<td id="blockm" width="85">{$info.textblock}</td>
</tr>
</table>
{/if}
{/foreach}</td> |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
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
|